I guess you can do like this. Since Activity1 is started right? In
your service just start activity1 and make your activity1 as
singleinstance in AndroidManifest.xml and so Activity1#onNewIntent()
will be called. In onNewIntent to start activity2 and finish
Activity1.

On Jun 1, 6:57 pm, domel <szczur...@poczta.fm> wrote:
> Hi
>
> I have a service that listens to the serial port. According to data
> received from serial i switch between particular service states, and
> start particular activities on state transitions. I would like to
> accomplish it in following way: Let's assume there is one active
> Activity1 started from previous state, I call startActivity from
> service to start a new one Activity2, but I want to simulatenously
> destroy Activity1 when Activity2 gets on top of the stack. I tried to
> call finish() in Activity1.onStop but it seems not to work
> (Activity1.onDestroy() doesn't get called). I'd prefer to finish
> Activity1 after Activity2 gets on top in order to avoid blinking.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to