Guest User

Untitled

a guest
Mar 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. adapter = new ArrayAdapter(getApplicationContext(), R.layout.my_cutom_layout, villes);
  2. listV.setAdapter(adapter);
  3. listV.setBackgroundColor(Color.BLUE);
  4. listV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  5. public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  6. Toast.makeText(getApplicationContext(), "On va à : "+(position+1)+" "+villes.get(position), Toast.LENGTH_SHORT).show();
  7. String [] villeData = {getZone,""+(position+1) ,villes.get(position)};
  8.  
  9. intent.putExtra("ville", villeData);
  10. startActivity(intent);
  11.  
  12. }
  13. });
Add Comment
Please, Sign In to add comment