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
| Button modif = (Button) findViewById(R.id.button4);
modif.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
maListViewPerso.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
@SuppressWarnings("unchecked")
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
//on récupère la HashMap contenant les infos de mon item (titre, description, img, prix)
HashMap<String, String> map = (HashMap<String, String>) maListViewPerso.getItemAtPosition(position);
String titre = (String) map.get("titre");
String img = (String) map.get("img");
String prix = (String) map.get("prix");
if (map.get("type") == "aperitif") {
Intent intent = new Intent(Recap.this, Aperitif.class);
startActivity(intent);
}
.
.
. |
Partager