On Sat, Aug 14, 2010 at 6:04 PM, viktor <victor.scherb...@gmail.com> wrote:
> OK, my third try to  tell you what is my issue mean.
>
> For example: Activity0 -- it is a super class, Activity1, ...2, ...
> 3, ...4 my children classes from Activity0.
>
> Activity1 extends Activity0
>
> Activity1, ...2, ...3, ...4 can start another examples of Activity0,
>
> My activity stack can be like this: Activity1; Activity5;
> Activity12(top).
>
> .....
>
>
> My customers want that application update some information if app
> comes to foreground. In my case it happen in Activity0 { onMyUpdate()
> {..} }.
>
> Android application can go to the background by HOME button. If Home
> pressed onPause() will call.
>
> If app come to the foreground by long click on HOME onResume() is
> call.
>
> I try call my method in all Activity life cycle methods but result the
> same, my method calling always, when activity is coming to the
> foreground, back to previous activity, start new activity.

That's how supossed to be. When Activity1 launchs Activity5, Activity1
goes background and can be killed at any time by the system. Now, if
you go to home, Activity5 goes to backgroud. Going back to your
application, Activity5 cames on foreground. Pressing back, Activity1
goes to foreground destroying Activity5.

I think you'll need to redesign as you can't think yourself from where
you are coming to foreground. If you are using only different views,
try thinking on that: using just differents views (if they aren't too
much though).

> Where I can put my update method if activity return to the foreground?

If you want just play dirty, maybe there's a way to catch the "home"
button press (I don't know if possible) event. But, your activity can
be killed at any time. You can't make assumptions when your activity
is no more visible.

-- 
If you want freedom, compile the source.

Sebastián Treu
http://labombiya.com.ar

-- 
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