0
Drawable appIcon = packageManager
.getApplicationIcon(packageInfo.applicationInfo);
的URI如何獲得的appIcon
的URI?如何獲得DrawableImage的Android
Drawable appIcon = packageManager
.getApplicationIcon(packageInfo.applicationInfo);
的URI如何獲得的appIcon
的URI?如何獲得DrawableImage的Android
Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name");
InputStream stream = getContentResolver().openInputStream(uri);
使用ContentResolver的開放資源的URI
格式爲:
"android.resource://[package]/[res id]"
[package] is your package name
[res id] is value of the resource ID, e.g. R.drawable.sample_1
to stitch it together, use
Uri path = Uri.parse("android.resource://your.package.name/" + R.drawable.sample_1);
提拉不是從我的包來了... –