Android : android - Alert Dialog + intent

on Thursday, March 19, 2015



public void screen2 (View view) {

final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("screen2");
builder.setMessage("go to screen2?");

builder.setPositiveButton("yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(this,Screen2Activity.class);
startActivity(intent);

}


I want to start an activity from an AlertDialog but i found an error on "Intent intent = new Intent(this,Tela2Activity.class);"


ANY HELP??


0 comments:

Post a Comment