Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Settings of Android Phone on a button click in our Android App

Tags:

android

I have a problem that I want to open Phone's Setting Screen on a Alert Dialog Ok button click. Means In my App I have a Dialog in which there are two buttons Ok and Cancel, I want to open Phone's Setting Screen on Ok Button Click, I don't know how to do that? please suggest me the right result.

Thanks in advance.

like image 419
Sanat Pandey Avatar asked Nov 01 '11 12:11

Sanat Pandey


People also ask

How do I open Android settings?

You can swipe down on the notification bar at the top of your phone display, then tap on the top right account icon, then tap on Settings. Or you can tap on the “all apps” app tray icon in the bottom middle of your home screen. This will show you a list of apps, and you can swipe through to find and tap on Settings.

Can you open settings menu?

From the Home screen, tap Apps > the Apps tab (if necessary) > Settings . From the Home screen, tap the Menu key > Settings. Select a setting category and configure the desired settings.

How do I open Quick Settings?

To find the Android Quick Settings menu, just drag your finger from the top of your screen downward. If your phone is unlocked, you'll see an abbreviated menu (the screen to the left) that you can either use as-is or drag down to see an expanded quick settings tray (the screen to the right) for more options.


2 Answers

this should do it

startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); 

starts settings activity for result

like image 57
Optimus Avatar answered Sep 23 '22 11:09

Optimus


Intent dialogIntent = new Intent(android.provider.Settings.ACTION_SETTINGS); dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(dialogIntent); 
like image 43
ud_an Avatar answered Sep 23 '22 11:09

ud_an