How 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.
Asked
Active
Viewed 1,316 times
5

BarmanInfo
- 392
- 1
- 18
-
give any reference image. – Mohammad Tauqir Oct 02 '15 at 19:07
-
http://i.stack.imgur.com/pTlQn.png – BarmanInfo Oct 02 '15 at 19:09
1 Answers
-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.
-
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