Reputation: 93
I know how to do this converting it to a bitmap, but I want an Image (android.media) on the receiver side.
Thanks in advance.
Upvotes: 0
Views: 68
Reputation: 12358
If you want to pass only one bitmap at a time, I suggest creating a static variable in a class. and assign the bitmap object to it, and use it in the receiver class.
But if this is very big bitmap, it may cause OutOfMemory issue.
Upvotes: 1
Reputation: 10278
You probably don't want to do this. Even if you create a Serializable
or Parcelable
object that includes your data like this:
which you may be able to do, by creatively encoding your image.
But an Intent
has a limitation in size. See this post here:
Maximum length of Intent putExtra method? (Force close)
It says 1MB, but in my experience it might be as high as 4MB, depending on the platform (I may have that wrong, I don't have a specific reference to Android documentation to support it, but I see errors that appear to support it).
I'm sure you can move a lot of images within this restriction, but for any that fall outside of it, you will need a "work around" - which you should then probably make the "standard" and avoid the issue altogether.
Upvotes: 0