Tuesday, August 2, 2011

[android-developers] Re: Comms with Intent

Actually one more question - since I want the Activity to keep alive
with the camera preview on, would the subsequent Intent launching
(and calls to OnNewIntent) allow me to control the open preview. I
think
yes since the Activity (unless I call finish()) should still be active
right?

On Aug 1, 9:56 pm, Nikolay Elenkov <nikolay.elen...@gmail.com> wrote:
> On Tue, Aug 2, 2011 at 4:18 AM, kypriakos <demet...@ece.neu.edu> wrote:
>
> >> You could launch the activity using the FLAG_ACTIVITY_SINGLE_TOP
> >> flag. Then when you call startActivity() again, a new instance
> >> won't be created, the intent will be delivered to onNewIntent().
>
> > So if I still have a handle to the intent when I relaunch it as you
> > describe above, would I still be able to call methods on it.
>
> You can make a new intent every time, and change the data/extras
> as needed. Then in your Activity's onNewInent() you look at each
> received intent's contents and decide what to do.  Calling methods
> on an Intent doesn't communicate with the Activitiy, you need to
> deliver the intent.

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

No comments:

Post a Comment