[AlertDialog & Intent]Erreur passage d'intent
Bonjour ,
J'ai je pense une erreur "bateau" que je ne comprend pas trop ...
Je m'explique j'ai plusieurs button sur mon Activity , et sur l'un des boutons je voudrais passer sur une autre activity (apres un alertdialog de confirmation).
J'ai bien créer ma deuxième Class nommer : Second.java , et créer la vue XML(second.xml)
Mais il me sort une erreur je vous met le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
((Button)findViewById(R.id.Second)).setOnClickListener(new OnClickListener() {
public void onClick(View v) {
showDialog(3);
}
});
/*-------------------------------------------- */
case 3:{
return new AlertDialog.Builder(this).setMessage("Rokseur").setTitle("BANZAIII")
.setPositiveButton("Normal", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(this,Second.class);
startActivity(intent);
}
})
.create();
} |
L'erreur ce trouve sur :
Code:
Intent intent = new Intent(this,Second.class);
Il me propose juste de :
Citation:
The constructor Intent(new DialogInterface.OnClickListener(){}, Class<Second>) is undefined
- Remove argument to match 'intent()'
Vous remerciant pour le debuggage ,
Cordialement ,