简体   繁体   中英

How to hide other application Shortcut icons on android desktop from my android application

I am in the finally stage of developing my android application and what i am left with is to hide all other application icon on the phone´s desktop with my application. Now I found this code here and I have tried to modify it and even add the proper permission but seem not to be getting the desired result. Kindly help me modify it or suggest how i can modify it to do what i want. Here is the code

Intent myLauncherIntent = new Intent();
myLauncherIntent.setClassName("your.package.name", "YourLauncherActivityName");
myLauncherIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myLauncherIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Application Name");
intent.putExtra
   (
    Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
    Intent.ShortcutIconResource.fromContext
                                (
                                     getApplicationContext(), 
                                     R.drawable.app_icon
                                )
   );
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
getApplicationContext().sendBroadcast(intent);

I would appreciate all the help i can get. Cheers guys.

what i am left with is to hide all other application icon on the phone´s desktop with my application.

Fortunately, this is not possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM