Hello Friend I'm working on Launcher Application. for select my launcher as Home app a popup is showing in samsung. by using this code.
private void launchAppChooser() {
PackageManager packageManager = getPackageManager();
// get dummyActivity
ComponentName componentName = new ComponentName(context, DummyActivity.class);
// enable dummyActivity (it starts disabled in the manifest.xml)
packageManager.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
// create a new (implicit) intent with MAIN action
Intent intent = new Intent(Intent.ACTION_MAIN);
// add HOME category to it
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// launch intent
startActivity(intent);
// disable dummyActivity once again
packageManager.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
but this code is not working on OPPO and HUAWEI. I'm using following line for showing same popup to select home launcher
startActivity(Intent.createChooser(intent,"Select Launcher App"));
This code is showing popup with launcher Apps but when i clicked on any app its not set as default. Can i open homescreen Activity from setting in OPPO for choosing default launcher like this(please open image). because CM Launcher app is opening this activity Clicke here to open image Now i Want To Open This Activity Programetically. and Need Yours help for doing this.