JSon Array in Array

  • 1 Antworten
  • Letztes Antwortdatum
S

Sico

Erfahrenes Mitglied
51
Also irgendwie stehe ich auf dem Schlauch...

Wie komme ich an das erste Element eines Arrays in einem Array?

Ich komme nur mittels
Code:
jObject = new JSONObject(jString);
            JSONArray interview =  jObject.getJSONArray("item");
            
            
            JSONObject qa = questions.getJSONObject(0);

            String x = qa.getString("name");
            TextView tv1 = (TextView) findViewById(R.id.TextView01);
            tv1.setText(x);
an das erste Element im ersten Array...
 
Code:
jObject = new JSONObject(jString);
            JSONArray interview =  jObject.getJSONArray("item");
            
            
            JSONObject qa = questions.getJSONObject(0);
JSONArray interview1 =  qa.getJSONArray("people");
            
            
            JSONObject interview2 = interview.getJSONObject(0);


            String x = interview2.getString("name");
            TextView tv1 = (TextView) findViewById(R.id.TextView01);
            tv1.setText(x);
So hats geklappt
 
  • Danke
Reaktionen: Sentence
Zurück
Oben Unten