Reputation: 5534
I want to add my app Icon to created folder instead of default folder icon.
I know i can create folder with following code.
String extr = Environment.getExternalStorageDirectory().toString();
File mFolder = new File(extr + "/My Application/Downloads");
if (!mFolder.exists()) {
mFolder.mkdirs();
}
By doing this, i'm getting following result.
but what i want is..
I have searched a lot, but no luck. can anyone help me out?
Thank you.
Upvotes: 5
Views: 905
Reputation: 4199
After creating new directory you have to declare resource directory in your gradle file so that android studio can recognize new resource directory.
More information please refer https://developer.android.com/studio/write/add-resources
Upvotes: 0
Reputation: 4365
Customization of folder icon is OS dependent.
Note: I assumed, that you want to add icon to arbitrary folder and not your app laucher.
Upvotes: 0
Reputation: 1006819
Directories do not have icons, and so whatever app or tool your screenshot is from is adding that. You would have to ask the developers of that app or tool what algorithm they are using to determine the icon to show.
Upvotes: 8