Durch ListView iterieren

M

muck

Ambitioniertes Mitglied
7
Hallo,
ich erstelle eine ListView
Code:
[SIZE=2]SimpleCursorAdapter productListAdapter = [/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] SimpleCursorAdapter ([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2], R.layout.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]product_list_view[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]productList[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String[] {[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"sum"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"isopen"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]}, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][] {R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]text1[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tag[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]});[/SIZE][/LEFT]
 
[LEFT][SIZE=2]setListAdapter(productListAdapter);[/SIZE][/LEFT]
 
 
[LEFT][SIZE=2]ListView listView = (ListView) findViewById( android.R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]list[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2] );[/SIZE][/LEFT]
Jetzt würde ich gerne durch die ListView laufen und für jedes Item "android:tag" auslesen um das Item checked oder nicht checked zu setzen. Tag hätte ich mal so gefüllt:



Code:
[SIZE=2][COLOR=#3f7f7f][SIZE=2][COLOR=#3f7f7f]CheckedTextView [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#7f007f][SIZE=2][COLOR=#7f007f]xmlns:android[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]=[/SIZE][I][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff][URL]http://schemas.android.com/apk/res/android[/URL][/COLOR][/SIZE][/COLOR][/SIZE][/I][LEFT][LEFT][SIZE=2][COLOR=#7f007f][SIZE=2][COLOR=#7f007f]android:id[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]=[/SIZE][I][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"@+id/text1" [/COLOR][/SIZE][/COLOR][/SIZE][/I][/LEFT]

 
[LEFT][SIZE=2][COLOR=#7f007f][SIZE=2][COLOR=#7f007f]android:tag[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]=[/SIZE][I][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"@+id/tag"[/COLOR][/SIZE][/COLOR][/SIZE][/I]...[/LEFT]
[/LEFT]

Geht das überhaupt und wenn Ja wie?
Im voraus vielen Dank.

Gruß
 

Ähnliche Themen

A
Antworten
10
Aufrufe
1.021
swa00
swa00
D
Antworten
9
Aufrufe
1.767
jogimuc
J
J
  • JoEntwickler
Antworten
0
Aufrufe
974
JoEntwickler
J
Zurück
Oben Unten