Bonjour,

J'ai une application de gestion de client et lorsque que clic sur un client, je souhaiterai le remonter d'un cran. Par exemple, j'ai 4 clients, si je clic sur le 3, je voudrais qu'il passe en position 2.

Voici mon activité principale:
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
43
44
45
46
47
public class MainActivity extends Activity implements OnItemClickListener {
 
	private ListView listView;
 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
 
		GestionBD gestionBD = new GestionBD(this);
 
		LitFichier litFichier = new LitFichier();
		litFichier.execute("http://192.168.1.16/livraisons.xml");
 
		try {
			if (litFichier.get())
			{	
				gestionBD.init(litFichier.getLivraisons());
 
				listView = (ListView) findViewById(R.id.listView1);
 
				ArrayList<HashMap<String, String>> liste = gestionBD.donneInfo();
				SimpleAdapter adapter = new SimpleAdapter(this, liste, R.layout.liste_client,
						new String[] {"client", "adresse", "nbColis" ,"mtTotal"},
						new int[] {R.id.client, R.id.adresse, R.id.nbColis, R.id.mtColis });
 
				listView.setAdapter(adapter);
				listView.setOnItemClickListener(this);
			}		
			else
				Log.i("lithttp", "Problème lecture fichier");
		} catch (InterruptedException e) {
			Log.i("lithttp", "Interruption lecture fichier");
		} catch (ExecutionException e) {
			Log.i("lithttp", "Problème exécution");
		}
	}
 
	@SuppressWarnings("unchecked")
	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {		
		Toast.makeText(MainActivity.this, "cliqué sur "+
				((HashMap<String, String>) listView.getAdapter().getItem(position)).get("client"),
				Toast.LENGTH_SHORT).show();
	}	
 
}