Bonjour à tous

J'essaie depuis plusieurs heures de faire fonctionner ma listView avec un ArrayAdapter, sans succès. J'ai essayé de coder une classe à part pour l'arrayadapter et ça ne fonctionne pas non plus. Même un exemple basique ne fonctionne pas: je n'ai rien qui s'affiche à l'écran. J'ai besoin de votre aide

Voici mon fichier xml contenant la listView:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
 
	<TabHost
		android:id="@android:id/tabhost"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
	>
 
		<TabWidget
			android:id="@android:id/tabs"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
		/>
 
		<FrameLayout
			android:id="@android:id/tabcontent"
			android:layout_width="match_parent"
			android:layout_height="match_parent"
		>
 
			<LinearLayout
				android:id="@android:id/content"
				android:layout_width="match_parent"
				android:layout_height="match_parent"
			>
			</LinearLayout>
		</FrameLayout>
 
	</TabHost>
 
	<ListView
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:id="@+id/itemlist" 
	/>
 
</LinearLayout>
Et mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
 
		itemList = (ListView) findViewById(R.id.itemlist);
		String[] array = {"a","b","c","d","e","f","g"}; 
		ArrayList<String> lst = new ArrayList<String>();
		lst.addAll(Arrays.asList(array));
		final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
		android.R.layout.simple_list_item_1, lst);
 
		itemList.setAdapter(adapter);
 
	}
Je n'ai pas mis tout mon code mais le passage qui vous intéresse.
Ca devrait marcher là non ? :'(

Merci d'avance pour votre aide