简体   繁体   中英

Where does Android store desktop icons?

Once an app is installed, where android store icons shown on app drawer? in which path? I tried to remove it programmatically but without success. An alternative should be to refresh the app drawer. Possible on rooted phones?

With the following code you will get icon and name for running applications, modify it to get normal applications etc.

c is your application Context.

ActivityManager activityManager = (ActivityManager) c
            .getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> rapiList = getRunningAppProcesses(c); //running or whatever
RunningAppProcessInfo rapi = rapiList.get(i); //iterate

Drawable icon = c.getPackageManager().getApplicationIcon(rapi.processName);
String name = c.getPackageManager().getApplicationLabel(c.getPackageManager().getApplicationInfo(rapi.processName, 128)).toString();

So the icons are part of the application process, not sure you can delete them, maybe you can modify your launcher (get a custom one)

You can study the source code at this url:

https://github.com/WouterSpaans/APK-Edit--Java-

This tool can edit app icons.

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