Sunday, April 28, 2013

[android help] HTC One X+ Home Sence Launcher won't let me clear defaults programmatically


I want to show Settings->Applications->Manage Applications-> home launcher application ->'Clear Defaults' programmatically in my application.This works fine in all devices except HTC One X+.


In HTC One X+, 'Home Sence' application is set as default home launcher.When i tried to set my application as home launcher this shows Resolver Dialog too.


In my application i want to clear the default settings of current home launcher application and set mine as home launcher.So,I tried this code



Intent intent = new Intent();
final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 9) { // above 2.3
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", packageName, null);
intent.setData(uri);
} else {
// below 2.3
String appPkgName = (apiLevel == 8 ? "pkg" : "com.android.settings.ApplicationPkgName");
intent.setAction(Intent.ACTION_VIEW);
intent.setClassName(APP_DETAILS_PACKAGE_NAME, APP_DETAILS_CLASS_NAME);
intent.putExtra(appPkgName, packageName);
}
this.startActivity(intent);


But it won't let me show the 'Clear Defaults' of HTC Sence.It works for any other application on this device.What is the problem here? Why 'HTC Sence' won't let me to clear defaults?How can i fix this?


Thanks in Advance



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...