Mr. Robin is right. You can do it manually.
Put your entire custom icon in the drop-down folder with a specific name, for example icon_appname.png
..
icon_contacts.png, icon_camera.png, icon_settings.png, icon_phone.png, icon_email.png ... etc.
or you can also save images as a package name, just like icon_com_android_camera.png ... etc.
Just set the condition to GetView
in the adapter class.
if(User selected default theme) { //use default icon from system } else { String appname = here is app name; String appPackageName = here is app package name; // You can use appname or appPackageName as per your drawable name. int intResource = getResources().getIdentifier("icon_" + appname.toLowerCase(), "drawable", getPackageName()); if(intResNormal!=0) holder.txtTitle.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(intResource), null, null); else //use default icon when no resource found }
Note: If you follow the package name, be sure to replace "_" with ".
source share