[android-developers] Re: accessing raw resources from within my library
Is the mContext from the main project or from the library?
If it is from the main project, then that would get the resources from the main project, not the library.
What you want to do in the main application is something like:
PackageManager pmMgr = getPackageManager();
Resources rMgr = pmMgr.getResourcesForApplication( library.package.name.here );
Then you can access the library resources like normal from the main application.
If you want to access them via the library to hand over to the main application instead of accessing them directly, you'll need to get the context for the library and use it to open the resources.
Steven
Studio LFP
http://www.studio-lfp.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home