androidkotlinandroid-settings

Opening Android Settings programmatically


How can I open settings programmatically?


Solution

  • I used the code from the most upvoted answer:

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

    It opens the device settings in the same window, thus got the users of my android application (finnmglas/Launcher) for android stuck in there.

    The answer for 2020 and beyond (in Kotlin):

    startActivity(Intent(Settings.ACTION_SETTINGS))
    

    It works in my app, should also be working in yours without any unwanted consequences.