On Tue, Mar 5, 2013 at 4:41 PM, Piren <[email protected]> wrote:

> Not sure what the issues you mention, never had those... onPause/onResume
> are pretty much the only lifecycle events that are constant in behavior :)
>
>
I described it in my original post - in short, if the main activity is
being paused because the user is leaving the app, a lot of things have to
be closed, saved, cleaned up etc.  If it's being paused just to show
preferences, those things should not happen.


> The way you describe it, it should be simple, so not sure what you're
> missing... I suggest you stop using the Pref's activity onResume/onPause to
> decide anything in the app (other than saving the prefs themselves) and
> instead base on the Main activity's onStop/onActivityResult
>

I'm not keen to make decisions in prefs activity's onPause() (and I'm not
doing it yet) but it kind of follows from having to make decisions in the
main activity's onPause().  As a simple example, if the main activity is
being paused just to show preferences, it doesn't stop music playback.
 Now, on pausing the prefs activity, you have to decide - if you're going
back to the main activity you leave music playing.  If you're leaving the
app entirely, you must stop it.


>
> it can't be that Android application architecture is forced to fall apart
>> into a bunch of Activities who can't coordinate among themselves
>> efficiently...
>
>
> Thats exactly how android is designed... Android is completely designed
> around the fact that each activity is its own "world" and should not depend
> on any other activity. Each activity is its own "application".. they state
> it several times in their documentation.
>

If that's the case the only solution is to get rid of the
PreferenceActivity and make it a law that the app will always be using
precisely one Activity - the main one.

Do you happen to know what it would take to replace PreferenceActivity with
a full-screen Dialog?

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to