I am having trouble in parsing my XML, I have tried many things.
I have xml like this.
I have built my own parser for parsing this xml.
Here is the code
public class ProfileHome extends Activity {
public String id="";
public String text="";
public ArrayListoption = new ArrayList();
public String singleoption="";
List q;
private Questions question = new Questions();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.profile_home);
String payload = " ";
q = new ArrayList();
if(payload.contains("question"))
{
for(int i=0;i"))
{
ques.setOptions(option);
q.add(ques);
k=k+11;
break;
}
//now get all options and their id's
for(int j=k+11;j"))
{
option.add(singleoption);
singleoption="";
k=j+9;
break;
}else{
singleoption = singleoption +payload.substring(j,j+1);
}
}
}
}
}
}
}
}
for(int i=0;i