Bitmp是使用putParcalable方式传过去的.
Bitmp是使用putParcalable方式传过去的.
Bitmp是使用putParcalable方式传过去的.
2015-05-09
没错,bitmap是Parcelable的实现类。图片过大就会有:android.os.TransactionTooLargeException
建议可以把图片url路径或id传过去。
发送:
Intent intent = new Intent(FirstActivity.this,SecondActivity.class);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
Bundle bundle = new Bundle();
bundle.putParcelable("bitmap", bitmap);
intent.putExtras(bundle);
startActivity(intent);
接收:
iv_content = (ImageView) findViewById(R.id.iv_content);
Intent intent = getIntent();
if(intent!=null){
Bitmap bitmap = intent.getParcelableExtra("bitmap");
iv_content.setImageBitmap(bitmap);
}
举报