1

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.

4

1 に答える 1

2

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);
于 2012-11-28T21:07:32.873 に答える