Is there a way to get the icon for any file in Android? I am building a file browser app. I tried this… but the ApplicationInfo object is setting to null.
PackageInfo pkgInfo = getPackageManager().getPackageArchiveInfo(currentPath+pathName, 0);
ApplicationInfo appinfo = pkgInfo.applicationInfo;
Thx!
Rahul.
You can get an icon only for application file (.apk), for the rest of file, you can retrieve the extension of the file and set your icon for each file.