-1

Hey I would like to add to my android app an option to hide/unhide all home screen icons and widgets, I know LG has done this in LG G2/LG G3. Users on these devices can pinch the home screen and all the apps are hidden then repinch to unhide.

I don't need it to work with pinching I just want to add a button to do so. Is there any method of doing so?

If there isn't a way I thought about adding a new home screen tab and setting it to the default home and the removing when unhide is pressed, is this way possible?

Thanks

EDIT: I found a this code

PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); // activity which is first time open in manifiest file which is declare as <category android:name="android.intent.category.LAUNCHER" />
p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

over here: Android hide/unhide app icon programmatically

but it uses the package name so its mostly intended for ones own app... Is it possible to get a list of all packages on device and iterate trough them and than remove them?

Community
  • 1
  • 1
Eliahu Horwitz
  • 499
  • 3
  • 17

1 Answers1

1

Hey i would like to add into my android app an option to hide/unhide all home screen icons and widgets

That is not possible in general. You are welcome to write your own home screen implementation that offers these features. Or, you might find some security-challenged home screen implementation with an API that allows third-party apps like yours to control it this way.

i know LG has done this in LG G2/LG G3

LG wrote their own home screen.

If there isn't a way i thought about adding a new home screen tab and setting it to the default home and the removing when unhide is pressed, is this way possible?

That is not possible in general. There is no requirement for a home screen to have a "tab", let alone allow third-party apps to control the creation of tabs, etc.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I found this app which does it, any idea how?https://play.google.com/store/apps/details?id=com.geekyouup.android.thecleaner&hl=en&referrer=utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_term%3Dhide+icons+on+home+screen+android&pcampaignid=APPU_1_TRYtVu2xFsrXUYDBjuAB – Eliahu Horwitz Oct 25 '15 at 17:58