I am creating one app with two activities, an image will load and shows in another activity,
this is my LogCat error, http://pastebin.com/BvLtcdz0
This is MainActivity.java code http://pastebin.com/9F1sNr8B
I am creating one app with two activities, an image will load and shows in another activity,
this is my LogCat error, http://pastebin.com/BvLtcdz0
This is MainActivity.java code http://pastebin.com/9F1sNr8B
getAssets()
needs a context
which you don't have until you call onCreate()
move
AssetManager assetManager = getAssets();
into onCreate()
Images can be sent through Intents
but it is better to save a file path and send the path then open from file with a String
path sent through the Intent
You can't do it directly, you need to convert it to a bitmap first
yourImageView.buildDrawingCache();
Bitmap passedBitmap = imageView.getDrawingCache();
Intent intent = new Intent(this, YourOtherActivity.class;
Intent.putExtra("passedBitmap", passedBitmap);
startActivity(intent);
then load it back up in your other activity
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("passedBitmap");
Found a similar question (maybe dupe)