views:

22

answers:

1

Hi, I'm using a raw resource by creating a folder res/raw/myfile and then using the code InputStream is = Resources.getSystem().openRawResource(R.raw.myfile);

This code throws a resource not found exception and in the logs it says "resources don't contain package for resource number 0x7f04000"

The code I used above is by my guess the correct one. All the other examples I've seen are not possible (2.1 sdk) as they may be old examples.

I've cleaned and built and used a fresh avd. My R.java looks like this public static final class raw { public static final int myfile=0x7f040000; }

A: 

Try this way.

  InputStream is = getResources().openRawResource(R.raw.myfile);
krunal shah