Awesome! Thanks Balwinder, your code works perfectly. A little exploration: I tried to use Intent.ACTION_MAIN instead of Settings.ACTION_SECURITY_SETTINGS for the action because that's what the DDMS seemed to indicate. But the difference is that it first leads me to the Settings, and then to Security & Location. But your code directly leads me to Security & Location, which is what I want for activity stack purposes. Thanks again.
On Aug 7, 12:43 pm, "Balwinder Kaur (T-Mobile)" <balwinder.k...@t- mobile.com> wrote: > Try this piece of code : > > ComponentName c = new ComponentName > ("com.android.settings","com.android.settings.SecuritySettings"); > > Intent i = new Intent(Settings.ACTION_SECURITY_SETTINGS); > i.addCategory(Intent.CATEGORY_LAUNCHER); > i.setComponent(c); > i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > startActivity(i); > > Cheers, > Balwinder Kaur > Open Source Development Center > ·T· · ·Mobile· stick together > > The views, opinions and statements in this email are those of the > author solely in their individual capacity, and do not necessarily > represent those of T-Mobile USA, Inc. > > On Aug 5, 3:46 pm, Teal <teal.b...@gmail.com> wrote: > > > > > Hi all, > > > I'd like to launch the Menu -> Settings -> Security & Location > > programmatically. I monitored the DDMS and noticed that the Intents > > being launched are as follows: > > > Intent { action=android.settings.SETTINGS flags=0x10200000 comp= > > {com.android.settings/com.android.settings.Settings} } > > Intent { action=android.intent.action.MAIN comp= > > {com.android.settings/com.android.settings.SecuritySettings} } > > > I tried to create an intent through > > new Intent(Context.this, com.android.settings.SecuritySettings) > > > but there is no package called "settings" after com.android that is > > accessible. So perhaps there's an action I can invoke to launch the > > Settings activity. I browsed > > throughhttp://developer.android.com/guide/appendix/g-app-intents.html > > andhttp://developer.android.com/reference/android/content/Intent.html, > > but couldn't find the appropriate action. > > > Does anybody have any idea on how to launch the Settings activity? > > Thanks.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---