Android : is it possible to extract R - resourse integer from a custom xml file?

on Sunday, October 26, 2014


I want to make a class which will look like this :



class Item {

public String header;
public int id;
public boolean ableToBeAddedToFavorities;
public int resId;

}


the last parameter I want to have is an R.string.resourceString int so I can access


so, for example it would be myItem.resID=R.string.third_chapter;


What I want to do - is to make xml to fill all theese objects at the start of application.


something like :



<literature>
<article header="third chapter"
addable="true"
resId="R.string.third_chapter" />
</literature>


of course, If I'll parse this resId with Integer.ParseInt - this will not give me the result. Is there any way to describe resId in xml?


0 comments:

Post a Comment