In my situation, I know some methods below
getApplicationContext().getResources().getIdentifier("nameOfDrawable", "drawable", packageName);
getApplicationContext().getPackageManager().getApplicationIcon(packageName);
I want to get app icon's drawable id, but I do not know the "nameOfDrawable" of the app icon. I say I don't know because the default app icon's name can be "ic_launcher.png" or be changed to other like "icon.png". I find the second method above can get the drawable of app icon, but then I don't know what to do. Does anyone know how to get app icon's drawable id? Please help, thanks!
In fact, I want to show a notification, but it need to use the icon's drawable id. I find the first method above can get app icon's drawable id, but it need the name of app icon file which can be different in different app. What I'm doing is to make a little library to do something, so something can not be confirmed.