Im new to android..
Im facing a problem in Nextbutton while displaying the next four option answers for question…
In my first time set text im getting the correct question and matched four option answers. What i needed is..
I have a nextbutton for displaying the next question and answers..When click on next button i can get the next question..
And at the same i need to get next four options from the arraylist….
How to implement this? Any help would be appreciated…Thanks a lot in advance..
protected void onPostExecute(String file_url) {
pDialog.dismiss();
ques1=new ArrayList<String>(new ArrayList<String>(ques1));
// j=0;
TextView txtque = (TextView) findViewById(R.id.que_txt);
txtque.setText(ques1.get(j));
answ1=new ArrayList<String>(new ArrayList<String>(answ1));
btn_practice1.setText(answ1.get(0));
btn_practice2.setText(answ1.get(1));
btn_practice3.setText(answ1.get(2));
btn_practice4.setText(answ1.get(3));
Button nextBtn = (Button) findViewById(R.id.nxt_btn);
nextBtn.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v){
j++;
TextView txtque = (TextView) findViewById(R.id.que_txt);
txtque.setText(ques1.get(j));
}
});
}
How can i implement the radiobutton text in onClick event of Nextbutton?
1 Answer