Reputation: 4103
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.
Upvotes: 28
Views: 81122
Reputation: 356
just sharing for Kotlin sample codes:-
val dialogIntent = Intent(android.provider.Settings.ACTION_SETTINGS)
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(dialogIntent)
Upvotes: 3
Reputation: 4921
Intent dialogIntent = new Intent(android.provider.Settings.ACTION_SETTINGS);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);
Upvotes: 17
Reputation: 2776
this should do it
startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
starts settings activity for result
Upvotes: 58