5

enter image description hereHow to add app icon in file explorer folder for my app.for specific app like facebook,app icon is shown in left bottom corner of this app folder (in phone internal memory Android/data/appfolder). How to add app icon for my app. Please suggest the solution.

BarmanInfo
  • 392
  • 1
  • 18

1 Answers1

-1

From your reference, consider each folder icon as a view:

   <RelativeLayout>
     Folder imageView
     AppIcon imageView
   </Relativelayout>

The App Icon image is VISIBLE or GONE as per your app has access to the particular package's icon.

To get the package icon under consideration, from here, use the following code:

try{
String pkg = "com.app.my";//your package name
Drawable icon = getContext().getPackageManager().getApplicationIcon(pkg);
imageView.setImageDrawable(icon);
}
catch (PackageManager.NameNotFoundException ne)
 {

 }

now check if icon is null or not. If null make app icon gone, else visible and set the icon of package

p.s. see in ES that package name and folder name are same.

Community
  • 1
  • 1
Karan
  • 2,120
  • 15
  • 27
  • he is asking is there any api to enable other file explorers assign your app icon on your folder. He is not making a file explorer himself – Rahul Verma Jul 04 '16 at 08:55