Is it a global application setting or a per-instance dialog?
2011/7/13 elvisdsdev <[email protected]>
> New to Android and playing with GPS settings. I've successfully been
> able to get my location and find the nearest locations based on a
> personal database. So far I have two activities. Activity 1 is a menu
> with an option to go the 2nd activity and in the future more menu
> options etc. In my second activity, i call an AlertDialog during
> onStart() to prompt the user asking whether he'd like to turn his GPS/
> location settings on. if they choose yes, then it calls an intent for
> the location source settings. Here's how I do that.
>
> private void openLocationMenu() {
> final ComponentName toLaunch = new
>
> ComponentName("com.android.settings","com.android.settings.SecuritySettings");
> final Intent gpsIntent = new
> Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
> gpsIntent.addCategory(Intent.CATEGORY_LAUNCHER);
> gpsIntent.setComponent(toLaunch);
> gpsIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
> startActivityForResult(gpsIntent,0);
> }
>
>
> Now, once I go back to my second activity after choosing their gps
> settings, I do not want my AlertDialog to be called again which it
> does because it's in the onStart() part of the UI flow.
>
> How do I have the app "remember" that it's already called the
> AlertDialog and the user's gone through those location steps already??
> obviously onStart() seems like the wrong place to put this method...
> can anyone help?
>
> --
> 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 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