0

I have code:

XmlResourceParser parser = context.getResources().getXml(R.xml.test1);

How to change last object in loop? (object = R.xml.test1)

For example, I create table:

int[] table = {(R.xml.test1), (R.xml.test2), (R.xml.test2)}

and this my object to change. How can do it properly?

2
  • 1
    Not clear. Please explain. Commented Feb 25, 2015 at 16:12
  • He wants to use the table array object to change the argument he is passing to getXml. He wants to use a loop to do this. Commented Feb 25, 2015 at 16:24

1 Answer 1

4

Perhaps loop over your table?

for (int resource : table) {
    XmlResourceParser parser = context.getResources().getXml(resource);
    //Do whatever you need to do with the parser
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.