I have a list view in an activity and when a row is selected I want to show another activity that contains an ImageView and a TextView. How can I set the image and text from the first activity? I'm guessing for the text I can use an extra with the intent.
intent.putExtra("data", bitmap)
intent.putExtra("your_string", strName);
You can recieve bitmap from another activity like this
Intent intent = getIntent();
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("data");
It costs a lot of memory and is also slow.
If you want to pass it inbetween activities, you can store it in a file. That's more efficient.
There are multiple ways to sending data between Activities
intent.putExtra("data", bitmap)
and recieve it as @deniz suggested
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.