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
   | @Override
    public void onClickNom(Contact item, int position) {
        TextView tv_Nom = (TextView)findViewById(R.id.TV_Nom);
        tv_Nom.setTag(position);
        final AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Contact " + position);
        builder.setMessage("Vous avez cliqué sur : " + item.getNom() + "\nVoici ses informations :\nMail : " + item.getMail() + "\nTel : " + item.getTel() + "\nAdresse : " + item.getAdresse());
        builder.setPositiveButton("Retour", null);
        builder.setNegativeButton("Supprimer", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                contactDAO.open();
                contactDAO.delete(Je ne sais pas quoi mettre); // car which me donne -2 car vue qu'il s'agit pas d'un vrai bouton mais d'un listView
                contactDAO.close();
            }
        });
        builder.show();
    }
} |