android - How to pass image from one activity to another -
activity 1:
imageview image=(imageview)findviewbyid(r.id.imageicon); in.putextra("image",r.id.imageicon); activity 2 :
int recipeimage = in.getintextra("image",0); imageview imageview=(imageview)findviewbyid(r.id.imageview1); imageview.setimageresource(recipeimage); issues :
java.lang.runtimeexception: unable start activity componentinfo{com.example.wireframe/com.example.wireframe.singlemenuitem}: java.lang.nullpointerexception
if want same image in 2 different activities, why not load image each activity? btw drawable in way:
drawable drawable = this.getresources().getdrawable(r.drawable.yourimage);
Comments
Post a Comment