0

I am creating a launcher app. Each time when the app is first launched, a dialog comes up that asks if the user wants to make this the default launcher with the options of "just once" or "always". I am wondering, how can I detect these settings and bring up this dialog whenever I want if my app does not have the "always" option set by the user. Basically I want the user to be forced to set my app as the default launcher, otherwise that prompt will continuously come up from time to time.

Here are my settings in my manifest. I am not sure of how to approach this, but my permissions have to be involved one way or another. This sort of implementation is common in children's operating systems that can be downloaded from the app store. Once downloaded and installed that dialog comes up, and if the user selects "just once", the dialog reappears with an explanation that "always" must be chosen in order for the app to function properly.

       <activity
            android:name=".activity.MainActivity"
            android:configChanges="locale|orientation"
            android:label="@string/app_name"

            android:screenOrientation="landscape"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

Thank you in advance.

portfoliobuilder
  • 7,556
  • 14
  • 76
  • 136
  • Looks like this is what you want: http://stackoverflow.com/questions/8299427/how-to-check-if-my-application-is-the-default-launcher If your app is not default, then you can show the user a dialog like you describe. – Bruce Jan 05 '15 at 18:39
  • You led me into the right direction is seems. It is another link within the link that you posted. If you want to post an answer I will upvote it. The link that looks correct is here http://stackoverflow.com/questions/6832321/which-launcher-is-running – portfoliobuilder Jan 05 '15 at 18:45
  • But it does not show me how to bring up the dialog though. – portfoliobuilder Jan 05 '15 at 18:51

0 Answers0