Every file type associated with its specific icon.
Now if i am choosing somefilename.xxx then how i could be able to choose the icon as
Try Using PackageManager.queryIntentActivities:
final Intent innt = new Intent(Intent.ACTION_VIEW);
innt.setData(fileUri);
innt.setType("application/pdf");
final List matches = getPackageManager().queryIntentActivities(innt, 0);
for (ResolveInfo match : matches) {
final Drawable icon = match.loadIcon(getPackageManager());
final CharSequence label = match.loadLabel(getPackageManager());
}