Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 res/raw 中有一个原始资源,但我无法使用它找到它
context.getResources().openRawResource(R.raw.mystore);
但它是在 R 文件中生成的
public static final class raw { public static final int mystore=0x7f040000; }
我尝试清理,刷新它,重新启动 Eclipes,但没有任何效果。
确保您导入yourpackage.R而不是android.R
yourpackage.R
android.R
试试这个。
InputStream is = getResources().openRawResource(R.raw.mystore);