I am using addPersistentPreferredActivity() method of DevicePolicyManager but its not working.
I made Google Nexus 5.0 android device as device owner using dpm command and after that I used above method to make my application's activity as HomeActivity but its not working.
Below is the piece of code which I am using:
IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN);
filter.addCategory(Intent.CATEGORY_HOME);
filter.addCategory(Intent.CATEGORY_DEFAULT);
devicePolicyManager.addPersistentPreferredActivity(demoDeviceAdmin,filter,new ComponentName(getApplicationContext(),LauncherActivity.class));
Can anyone help me to sort out this issue?