0
我在不同的活動中有兩個不同的字符串傳遞另一個活動並在imageview中分配。這個怎麼做?如何在同一活動中處理兩個不同的字符串android
Activity A:
Intent intent=new Intent(activity,B.class);
intent.putExtra("thumb_url", Image); // this is Bitmap
activity.startActivity(intent);
Activity C:
Intent intent = new Intent(activity,B.class);
intent.putExtra("thumb_urls", images)); //this is String
activity.startActivity(intent);
Activity B:
bundle = getIntent().getExtras();
if(bundle.containsKey("thumb_url") && bundle.containsKey("thumb_urls")
{
Bitmap bitmap=bundle.getParcelable("thumb_url");
String profile=bundle.getString("thumb_urls");
}
I don't know how to assign this in same imageview.
// bigger_image.setImageBitmap(bitmap); // how to assign in same imageview for bitmap and string.
// imageLoader.DisplayImage(profile, bigger_image); //
你錯了。 http://stackoverflow.com/questions/2459524/how-can-i-pass-a-bitmap-object-from-one-activity-to-another – 2014-10-29 10:10:13
無論如何,傳遞整個位圖需要大量內存@Pedro Oliveira – zhaokun 2014-10-29 10:24:17