android - Return/Pass ImageView file -


i generate imageview in androidlauncher , need use in 1 of screen classes, created interface. how can pass image , use in screen class? need make bitmap first?

what got right is:

uri selectedimage = data.getdata();             selectedimagepath = getpath(selectedimage);             imageview.setimageuri(selectedimage); 

and interface:

public interface purchinterface{ public void getselectedimage(); } 

and in androidlauncher:

@override public void getselectedimage() {     imageview.getdrawable(); } 

im in deep water here. note need able draw image in screen class.

you need return image encoded in format getselectedimage method. otherwise implementation retrieving drawable , dropping immediately.

you should refer converting android bitmap libgdx's texture


so interface be

public interface purchinterface {     public byte[] getselectedimage(); } 

and implementation be

@override public byte[] getselectedimage() {     // convert image bitmap, encode in byte array. } 

you can call interface's method , decode byte array using method described in above question.

hope helps.
luck.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -