Android: 什么是我自己的 App 资源的等价物而不是 android.resource://system/

Android: what is the equivalent for my own App resource instead android.resource://system/

我想使用我自己的资源(可绘制)而不是这个:

"android.resource://system/com.android.internal.R.drawable.ic_menu_recent_history"

收件人:android.resource://XXXX/R.drawable.ic_my_icon

将您的 drawable.xml 放入 res/drawable 文件夹并使用:

R.drawable.your_drawable_name

尝试 android.resource://com.example.myapp/drawable/ic_my_icon,请记住并非 Android 设备中的所有内容都支持 android.resource 方案。

有关此方案的更多信息,请参阅 the documentation for openAssetFileDescriptor()