Search code examples
androidapplication-settingspreferencescreen

Is there a way to launch my app's system settings in a PreferenceScreen


I can launch the device's App settings activity from a PreferenceScreen. When the activity loads, the activity displays a ListView with all of the different apps installed on the device. I can get to my app's system setting by scrolling through the list and clicking on the title of my app.

I make this happen in my preferences.xml file.

<PreferenceScreen
    android:title="@string/system_settings_preference_title" >
    <intent android:action="android.settings.APPLICATION_SETTINGS" />
</PreferenceScreen>

Is there a way to launch my app's system settings rather than having to scroll through the list?


Solution

  • Your app's system settings can launched using the following intent where com.myapp is the app's package name found in the manifest file.

    <PreferenceScreen
        android:title="@string/system_settings_preference_title" >
        <intent android:action="android.settings.APPLICATION_DETAILS_SETTINGS"
            android:data="package:com.myapp"/>
    </PreferenceScreen>