Really really do not pass large amounts of data (such as bitmaps) through an
Intent.  This data must be marshalled over to the system process, held there
the entire time the target activity can be in use, and marshalled back over
to the application process when the activity is being launched.

You can certainly put data in globals, but you need to be aware you will
lose this if your process gets killed (such as if the user presses home to
leave your app, goes and does something else, and memory is needed that
causes it ot be killed).  Then when the user returns to your app, your data
will be gone.

I would probably suggest that you store the data in a file.

On Tue, Apr 7, 2009 at 1:13 PM, Hwayoung <[email protected]> wrote:

>
> Hi. deer android developers :)
>
> I am developing an image applications.
>
> One activity decoding image file (jpg, bmp, and so on) to byte buffer
> RGB 565 or 888 type.
>
> then want to pass image buffer to another activity for change image
> data.
>
> i have 3 activity the main decoding activity[A] and selecting effect
> activity[B] and apply effect activity[C] for change image data.
>
> if i use intent then activity[A] should make intent[1] and putExtra to
> that intent.
> and then [B] call getIntent and getByteArrayExtra for get byte buffer.
>
> if user select effect then [B] make new intent[2] and putExtra to
> intent[2].
> and startActivityForResult with intent[2] and activity[C].
>
> then activity[C] call getIntent to get intent[2] and getByteArrayExtra
> for get byte buffer again.
>
> there takes much times to make new byte buffer and copy from parent's
> activity's byte buffer 2 times. [A]->[B] and [B]->[C]
>
> That process drops application performance.
>
> Questions
>
> 1. can i pass intent[1] to activity[C] without make new intent[2] and
> putExtra byte buffer? by modify intent[1]. (if it works just 1 buffer
> copy will perform)
>
> 2. can i use application global memory for share byte buffer? if i use
> hash map how can each activity access same hash map? (if it works
> don't need to copy buffer)
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to