G
Garnet
Ambitioniertes Mitglied
- 1
Hi,
folgendes Problem:
Ich habe eine Kommentarfunktion in meine App eingebaut, welche auf eine SQLite Datenbank zugreift, die auf einem Webserver liegt.
Wenn ich diese im Emulator ausprobiere, funktioniert auch alles. Aber wenn ich auf meinem Smartphone versuche zu einem Thema mehrere Kommentare zu schreiben, wird immer nur der neueste Kommentar angezeigt.
Hier ist der Code:
Ich hoffe es kann mir da einer helfen. Habe überhaupt keine Idee, an was das liegen könnte.
folgendes Problem:
Ich habe eine Kommentarfunktion in meine App eingebaut, welche auf eine SQLite Datenbank zugreift, die auf einem Webserver liegt.
Wenn ich diese im Emulator ausprobiere, funktioniert auch alles. Aber wenn ich auf meinem Smartphone versuche zu einem Thema mehrere Kommentare zu schreiben, wird immer nur der neueste Kommentar angezeigt.
Hier ist der Code:
Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]kommentareliste[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (ListView)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]listViewKommentare[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]); [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]saList[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] SimpleAdapter( [/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]myListing[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE]
[SIZE=2]R.layout.[/SIZE][I][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]dreizeiliges_item[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], [/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String[] { [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line2"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line3"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]},[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][] { R.id.[/SIZE][I][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]text1[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], R.id.[/SIZE][I][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]text2[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], R.id.[/SIZE][I][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]text3[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]}[/SIZE]
[SIZE=2]); [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]kommentareliste[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setAdapter([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]saList[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); [/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (isOnline())[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]getData();[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]while[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (![/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]dataComplete[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [U]es[/U] [U]soll[/U] [U]solange[/U] [U]gewartet[/U] [U]werden[/U] [U]bis[/U] die[/COLOR][/SIZE]
[SIZE=2][COLOR=#008080]// ArrayList [U]ganz[/U] [U]gefüllt[/U] [U]ist[/U] [U]und[/U] die[/COLOR][/SIZE]
[SIZE=2][COLOR=#008080]// [U]Abfrage[/U] [U]beendet[/U] [U]wurde[/U][/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2]Thread.[I]sleep[/I](50);[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (InterruptedException e) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].fillList();[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] getData() {[/SIZE]
[SIZE=2]Thread t = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Thread() {[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] run() {[/SIZE]
[SIZE=2]ArrayList<NameValuePair> nameValuePairs = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ArrayList<NameValuePair>();[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2]HttpClient httpclient = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] DefaultHttpClient();[/SIZE]
[SIZE=2]HttpPost httppost = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] HttpPost([/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][URL]http://public.xxx.de/~name/Kommentareanzeigen.php[/URL][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]httppost.setEntity([/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] UrlEncodedFormEntity(nameValuePairs));[/SIZE]
[SIZE=2]nameValuePairs.add([/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"param4"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]vortragID[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2]httppost.setEntity([/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] UrlEncodedFormEntity(nameValuePairs));[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (UnsupportedEncodingException e) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]HttpResponse response = httpclient.execute(httppost);[/SIZE]
[SIZE=2]HttpEntity entity = response.getEntity();[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = entity.getContent();[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (Exception e) {[/SIZE]
[SIZE=2]Log.[I]e[/I]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"log_tag"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Fehler bei der http Verbindung "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + e.toString());[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2]BufferedReader reader = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BufferedReader([/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] InputStreamReader([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"iso-8859-1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]), 8);[/SIZE]
[SIZE=2]StringBuilder sb = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] StringBuilder();[/SIZE]
[SIZE=2]String line = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]while[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ((line = reader.readLine()) != [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]) {[/SIZE]
[SIZE=2]sb.append(line + [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].close();[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = sb.toString();[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (Exception e) {[/SIZE]
[SIZE=2]Log.[I]e[/I]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"log_tag"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Error converting result "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + e.toString());[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]jArray[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] JSONArray([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]for[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] i = 0; i < [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]jArray[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].length(); i++) {[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]jArray[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getJSONObject(i);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]results[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].add((String) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Bewerter"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) + [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]" "[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]+ [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Kommentartext"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) + [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]" "[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]+ [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Bewertung"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]dataComplete[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (JSONException e) {[/SIZE]
[SIZE=2]Log.[I]e[/I]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"log_tag"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Error parsing data "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + e.toString());[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]};[/SIZE]
[SIZE=2]t.start();[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]public [/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] fillList() {[/SIZE]
[SIZE=2][COLOR=#008080]
[/COLOR][/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]for[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] i = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]jArray[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].length()-1; i >=0; i--)[/SIZE]
[SIZE=2]{[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]jArray[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getJSONObject(i);[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (JSONException e1) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e1.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][U]HashMap[/U] item = [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] [U]HashMap[/U]();[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2][U]item.put([/U][/SIZE][U][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Bewerter"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) )[/SIZE][/U][SIZE=2];[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (JSONException e) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2][U]item.put([/U][/SIZE][U][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line2"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Kommentartext"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) )[/SIZE][/U][SIZE=2];[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (JSONException e) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2][U]item.put([/U][/SIZE][U][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"line3"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Rating:"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]+[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]json_data[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].get([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"Bewertung"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])+[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"/5"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] )[/SIZE][/U][SIZE=2];[/SIZE]
[SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (JSONException e) {[/SIZE]
[SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#00ffff][SIZE=2][COLOR=#00ffff]TODO[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080] Auto-generated catch block[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]e.printStackTrace();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]myListing[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].add([U]item[/U]);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]saList[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].notifyDataSetChanged();[/SIZE]
[SIZE=2]}[/SIZE]
Ich hoffe es kann mir da einer helfen. Habe überhaupt keine Idee, an was das liegen könnte.