I have a main activity that launch the application. In the main activity I have an ImageView
that will get the string of a path from a selected thumbnails from a GridView
in a second activity via an intent.
This perhaps sounds strange and would be more naturally to launch the second activity first with the GridView
, but this is a requirement for the task.
So I'm struggling with the difficulties how to deal with the string imageId
that expects the intent from the second activity? I guess I will have to put a button to open the second activity and the GridView
like a menu button, but any ideas how to deal with the intent thing? Appreciate some help!
Code in the main activity:
String imageId = i.getExtras().getString("image");
ImageView imageView = (ImageView) findViewById(R.id.full_image_view);
Bitmap bitmap =BitmapFactory.decodeFile(imageId);
imageView.setImageBitmap(bitmap);