Intent intent=new Intent();
intent.setClass(A.this,B.class);
intent.putExtra("bitmap", bit);
startActivity(intent);
接收:
Intent intent=getIntent();
Bitmap bitmap=intent.getParcelableExtra("bitmap");
在數據傳遞過程中出現“FAILED BINDER TRANSACTION”錯誤,這種情況是因爲傳遞的數據過大導致的,系統對Intent傳遞數據有大小限制。
解決方法:A
B.bitphoto = bit; //bit爲傳遞的數據參數
B Activity接收:
<pre name="code" class="java">public static Bitmap bitphoto; //先聲明引用的參數,接收A中的參數,在B中可直接使用