Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何Bitmap在两个Activity实例之间传递一个对象?
Bitmap
Activity
Bitmap 实现 Parcelable,因此您始终可以在意图中传递它:
Intent intent = new Intent(this, YourNewActivity.class); intent.putExtra("BitmapImage", bitmap);
并在另一端检索它
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("BitmapImage");