I want to make my Launcher as Default Launcher. My code is Working properly for many but not wok on LeTtv device. because it's provide set default launcher from default app setting.
when run this code it's move on default Launcher but not show Launcher chooser Popup only in LeTv Device .
How to open Default app selection Setting?
my Code for Choose default launcher
private void setDefLauncher(Context c) {
PackageManager p = c.getPackageManager();
ComponentName cN = new ComponentName(c, FakeLauncher.class);
p.setComponentEnabledSetting(cN,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
Intent selector = new Intent(Intent.ACTION_MAIN);
selector.addCategory(Intent.CATEGORY_HOME);
c.startActivity(selector);
p.setComponentEnabledSetting(cN,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}
AndroidManifest.xml
<activity
android:name="com.android.launcher.launcher3.Launcher"
android:clearTaskOnLaunch="true"
android:enabled="true"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:resumeWhilePausing="true"
android:screenOrientation="nosensor"
android:stateNotNeeded="true"
android:taskAffinity=""
android:theme="@style/Theme"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
android:name="com.launcher2.activitys.FakeLauncher"
android:enabled="false"
android:excludeFromRecents="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Set Default Launcher manually Setting->Application Manager->Default App Setting->Set Launcher
I was search in Google ,StackOverFlow & Github but nothing I found, by my luck Some Luncher help me to redirect HomeStting Activity in Levt & MI phones, it's work as per my expectation . In Some it's work perfect ,I just Decompile it and Get used code for it.
for set Default launcher
.