0

I have searched all over the net and tried all the code But I am not getting a proper way to transfer my image from one activity to another activity. here is my Activity A:

Intent intent = new Intent(getApplicationContext(),Greeting.class);  //Greeting is Activity 2
intent.putExtra("editvalue", edit.getText().toString());              
intent.putExtra("path", ImageURI.toString()); //Got uri in the form of file:///storage/emulated/0/zedge/wallpaper/Incredible_quotes-wallpaper-10355947.jpg

startActivity(intent);

Here is how I retrieve my image in Activity 2:

Uri u=Uri.parse(intent.getStringExtra("path"));
Log.d("TAGGG222",u.toString());  //printing the sane URI as above.
imageview.setImageURI(u);

I am missing something and please if possible guide me with the correct way? Thank you

Misagh Emamverdi
  • 3,654
  • 5
  • 33
  • 57
therealprashant
  • 701
  • 15
  • 27
  • 1
    What happen to your program? Does it crash? If yes, what is logcat? Is u.toString() printed correctly? – Misagh Emamverdi Sep 22 '14 at 18:50
  • file:///storage/emulated/0/zedge/wallpaper/Incredible_quotes-wallpaper-10355947.jpg This is the URI of the selected Image in first Activity and I passed this uri to another activity and used imageView.setImageURI(uri) but it appears blank. The app doesnt crashes. – therealprashant Sep 22 '14 at 18:54
  • 1
    Check imageview is visible to user. Set its image resource statically in XML layout file and get sure it is visible. – Misagh Emamverdi Sep 22 '14 at 18:59
  • God Bless You Misagh. It was that problem itself – therealprashant Sep 22 '14 at 19:07

0 Answers0