> Hi, i have problem with opening files...
> this.res=imsLoader.context.getResources();
> this.context=imsLoader.context;
> InputStream istream=null;
> ...
> ...
> istream=res.openRawResource(R.raw.l6); //->> it works correcty that
> file is on res/raw/l6.lvl
> istream=context.openFileInput("l3.lvl"); // it give me FileNotFound
> exception
> istream=context.openFileInput("l"+level+".lvl"); // it give me
> FileNotFound exception

Use openRawResource() to open raw resources. Use openFileInput() to open
files stored in your app-private file store
(/data/data/your.package.name/files).

If you want to access resources by name, build yourself a
Map<String,Integer> mapping string names ("l3.lvl") to corresponding raw
resource IDs (R.raw.l3).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to