Reputation: 11
Is there a way to draw store an application icon in a drawable folder? I would like to display the application icon next to the application name in a list view.
I know there is a method to get the icon but I am not too sure how to store that icon so I can use it at a later time.
Upvotes: 1
Views: 306
Reputation: 46856
The application icon should already be stored in a drawable folder (in fact best practice is to have one stored in every density drawable folder)
You should be able to reference it at runtime just like anyother drawable using R.drawable.ic_launcher
or whatever name you gave the file if it wasn't ic_launcher
so to put it into an ImageView you could do something like
iv.setImageResource(R.drawable.ic_launcher);
Upvotes: 2