I am trying to read a layout XML file.
String file="res/layout/activity_main.xml";
InputStream in=mCurrentActivity.getClass().getClassLoader().getResourceAsStream(file);
InputStreamReader isr= new InputStreamReader(in);
BufferedReader br = new BufferedReader(isr);
while((line=br.readLine()) != null )
{
XposedBridge.log(line);
}
This is my code and this one is my corresponding XML file
the output that I get:
Since its my term project I need to figure it out fast(have 2 days left) so any help would be appreciated..
SOLUTION
I didn't have the id so first I get the id with :
int layoutId =mCurrentActivity.getResources().getIdentifier("activity_main", "layout",mCurrentActivity.getPackageName());
and then :
XmlResourceParser s = mCurrentActivity.getResources().getLayout(layoutId);
Thanks to Mike M.