AlertDialog.Builder myAlert = new AlertDialog.Builder(this);
myAlert.setMessage(username)
.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setTitle("Welcome To iShop!")
.create();
myAlert.show();
It is possible to make it just popup when the activity starts?
Just put the code you wrote inside the the Activity's onCreate() method.
@Override
protected void onCreate(Bundle savedInstanceState) {
AlertDialog.Builder myAlert = new AlertDialog.Builder(this);
myAlert.setMessage(username)
.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setTitle("Welcome To iShop!")
.create();
myAlert.show();
}