android - How can i get the url from an Image using two activities? -


i have 2 activities, 1 called listview, , second activity called informations, shows specific information specific user.

and pass 1 image listview, informations activity.

to image url user, i'm trying use intent.

listview activity

lv.setonitemclicklistener(new onitemclicklistener() {      @override     public void onitemclick(adapterview<?> parent, view view,             int position, long id) {          string checkid = ((textview) view.findviewbyid(r.id.id))                 .gettext().tostring();           string checkimage = ((imageview) view.findviewbyid(r.id.list_image)).getcontext().tostring();           intent in = new intent(getapplicationcontext(),                userprofile.class);          in.putextra("teste", checkid);         in.putextra("teste2", checkimage);          startactivity(in);       } }); 

informations activity

intent intent = getintent();  string id = intent.getstringextra("teste"); string image = intent.getstringextra("teste2");  picasso.with(this) .load(image) .into(imageview); 

but not working, how can that?

this not way url image. wrong.

string checkimage = ((imageview) view.findviewbyid(r.id.list_image)).getcontext().tostring(); 

you can set tag imageview however, need to in adapter. imageview.settag(url) , retrive string url = (string)((imageview) view.findviewbyid(r.id.list_image)).gettag();


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -