Hola alguien podria ayudarme a obtener los siguientes datos???, tengo un poco de codigo se los pongo para que me ayuden a ver como puedo sacar los datos de las preguntas ya que estas son dinamicas osea pueden ser n cantidad
Código JSON:
Ver original{
"Preguntas": [
{
"Pregunta2": [
{
"tipo": "TextView",
"id": 2,
"txtquest": "¿Que vamos hacer hoy?"
}
],
"Pregunta6": [
{
"tipo": "EditText",
"id": 6,
"txtquest": "¿EditText?",
"prueba": "solo es prueba"
}
],
"Pregunta7": [
{
"tipo": "CheckBox",
"id": 7,
"txtquest": "¿ESTO ES UN CHECKBOX? +++1"
}
],
"Pregunta5": [
{
"tipo": "Spinner",
"id": 5,
"lista": "Selecciona una opcion,Ultimate Game,Need for Speed,Ulimate Racing,Rockstar Games,Thunder Bolt"
}
],
"Pregunta4": [
{
"tipo": "RadioGroup",
"id": 4,
"txtquest": "¿Que RadioGroup? ",
"radios": 2
}
],
"Pregunta1": [
{
"tipo": "EditText",
"id": 1,
"txtquest": "¿ES SOLO UNA PRUEBA MAS DE EditText?",
"prueba": "solo es prueba"
}
],"Pregunta3": [
{
"tipo": "TextView",
"id": 3,
"txtquest": "¿ES SOLO OTRO TEXTVIEW?"
}
]
}
]
}
Código Java:
Ver originalfinal JSONObject obj = new JSONObject(resulta);
JSONArray datos = obj.getJSONArray("Preguntas");
System.
out.
println("datos.length()....... " + datos.
length()); for(int i=0;i<datos.length();i++){
System.
out.
println("IMPRIMIENDO EL TIPO DE I......FormularioForm " + i
); JSONObject json_data2 = datos.getJSONObject(i);
System.
out.
println("json_data " + json_data2
);