When I was having the project main_app, I was able to access the resources with-
int resId = getResources().getIdentifier("xml/" + rule_file, "string", "com.main_app.main");
Now, my project main_app is the library project for the project test_app.
But when I run the test_app I always get the exception at -
int resId = getResources().getIdentifier("xml/" + rule_file, "string", "com.main_app.main"); //Line 5456
The error log -
03-04 15:53:50.158: E/AndroidRuntime(29898): Caused by:
android.content.res.Resources$NotFoundException: Resource ID #0x0
03-04 15:53:50.158: E/AndroidRuntime(29898): at
android.content.res.Resources.getValue(Resources.java:1017) 03-04
15:53:50.158: E/AndroidRuntime(29898): at
android.content.res.Resources.loadXmlResourceParser(Resources.java:2102)
03-04 15:53:50.158: E/AndroidRuntime(29898): at
android.content.res.Resources.getXml(Resources.java:905) 03-04
15:53:50.158: E/AndroidRuntime(29898): at
com.main_app.main.ClainFragment$23.run(ClainFragment.java:5456)