The file manager named "File manager" does this for example. If I browse to the dir with my movies, they will be displayed with the Gallery icon as they open with that app by default. But when I install a new movie player, the icon will change to that of the player. So how would I go about retrieving the icon associated to each file (the application it opens with)?
I guess you could (untested);
Take all installed applications (using PackageManager
):
How to get a list of installed android applications and pick one to run
Take an icon for a specific application:
http://developer.android.com/reference/android/content/pm/PackageItemInfo.html#icon
Hope it helps.