In my AlertDialog, I added only one button. When I click to this button, I hope that I return to the home.
This is the code :
AlertDialog alertDialog = new AlertDialog.Builder(Main.this).create();
alertDialog.setTitle("Débit !!");
alertDialog.setMessage("Votre débit de téléchargement est "+deb);
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
I know that I need to add some Lines in public void onClick(DialogInterface dialog, int which). But, I don’t kniw what I’ll put in.
Please, I need your suggestion.
If you are trying to go to a certaint activity within your application this should do it.