radGrp = (RadioGroup) findViewById(R.id.respuestas3RG); radBotA = (RadioButton) findViewById(R.id.respuesta3A); radBotB = (RadioButton) findViewById(R.id.respuesta3B); radBotC = (RadioButton) findViewById(R.id.respuesta3C); radBotD = (RadioButton) findViewById(R.id.respuesta3D); NombrePrueba = (Button) findViewById(R.id.botonprueba); bPrevious = (Button) findViewById(R.id.botonantes); bNext = (Button) findViewById(R.id.botondespues); bFinalizar = (Button) findViewById(R.id.botonfinalizar); pregunta = (TextView) findViewById(R.id.enunciado3); enunciado = (ImageView) findViewById(R.id.imagen3); questions = new Questions(); currentQuestion(); // VisibilityNext(); //pruebaEstados if(radBotA.isChecked()){ Respuestas[posicion]="A"; }else if (radBotB.isChecked()){ Respuestas[posicion]="B"; } else if (radBotC.isChecked()){ Respuestas[posicion]="C"; } else if (radBotD.isChecked()){ Respuestas[posicion]="C"; }
bPrevious.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { posicion = posicion -1; questions.Previous(); currentQuestion(); if (Respuestas[posicion].equals("A")){ radBotA.setChecked(true);} else if (Respuestas[posicion].equals("B")){ radBotB.setChecked(true);} else if (Respuestas[posicion].equals("C")){ radBotC.setChecked(true);} else if (Respuestas[posicion].equals("D")){ radBotD.setChecked(true);} //checked else{ radBotA.setChecked(false); radBotB.setChecked(false); radBotC.setChecked(false); radBotD.setChecked(false); } } }); bNext.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { posicion = posicion +1; questions.Next(); currentQuestion(); if (Respuestas[posicion].equals("A")){ radBotA.setChecked(true);} else if (Respuestas[posicion].equals("B")){ radBotB.setChecked(true);} else if (Respuestas[posicion].equals("C")){ radBotC.setChecked(true);} else if (Respuestas[posicion].equals("D")){ radBotD.setChecked(true);} //checked else{ radBotA.setChecked(false); radBotB.setChecked(false); radBotC.setChecked(false); radBotD.setChecked(false); } }
However the function doesnt doe what it should do. For instance If I select the B answer and I go to the previous question the only thing that these makes is that i cannot select in that question the answer B.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)