我正嘗試訪問活動(如A)中正在捕獲的另一活動(稱爲B)中的圖像。現在在這裏,我有兩種選擇:將位圖作爲位數組發送到下一個活動
1. Save to sd card and then access in activity B through the filepath.
But, time taken to save is higher in some cases, probably because of higher
image size.
2. Send the bit array through intent.putExtra("imageArray" , data) and access it
in activity B through getIntent(). But on surfing net, I found sending bigger
bitmap of 1MB or more is a bad practise but didn't find anything with regards to
bitarray.
有人可以告訴我哪個選項更好嗎?併發送一個更大的bitArray位圖到另一個活動是一個不好的做法?
我的要求是:兩個活動之間的時間差A和B應該是最小的。此外,圖像應該立即加載到活動B中。
在此先感謝。
將其添加到意圖之前將其轉換爲字節數組,然後將其發送出去並解碼。 – 2014-10-22 06:12:34
http://stackoverflow.com/questions/11010386/send-bitmap-using-intent-android – 2014-10-22 06:12:52
@AnikIslamAbhi它需要大量的時間來保存圖像SD卡,這是令人煩惱。 – vijay 2014-10-22 06:14:33