0

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.

net_whiz
  • 135
  • 2
  • 15

1 Answers1

2

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • thanks. But what other methods or ways can I use to accomplish my aim which is to allow 3G access to only the application I select. I have read about rooting the device first. But is there no other way than rooting? – net_whiz Feb 13 '12 at 13:30
  • @net_whiz: You are welcome to write your own home screen that has the behavior you seek. – CommonsWare Feb 13 '12 at 13:33
  • hey commonsware, Please i need your assistance.I am trying to create an application with icons that can check if a specific application is installed in the android device. Please check this question and help me with modifying the code. http://stackoverflow.com/questions/9311640/checking-if-a-particular-application-is-available-in-the-android-device/9312036#9312036 – net_whiz Feb 16 '12 at 16:17