Jump to content

boite de dialogue, layout et listener


skysee

Recommended Posts

Bonjour à tous,

Je créé une boite dialogue comme suis:

AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setView(LayoutInflater.from(this).inflate(R.layout.layout_dialog,null));

dans mon layout_dialog : j'ai deux boutons. Si j'utillise la méthode classique pour gérer le click l'application plante. Tout les tuto que j'ai vu utillisent setNegativeButton et setPositiveButton, mais perso ca ne m'interresse pas. Pourquoi ne puis je pas utilliser ((Button)findViewById(R.id.bouton1)).setOnClickListener(this); Comment dois je gérer le click sur un bouton dans une boite de dialogue?

Merci

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...