AlertDialog box example

String logintatus = WebServiceHelper.authenticateUser(username, password);
System.out.println("<<<<<<<< loginstatus >>>>>>"+logintatus);
if(username.equals("")){
AlertDialog.Builder alertLogout = new AlertDialog.Builder(v.getContext());
alertLogout.setTitle("Login details");
alertLogout.setMessage("Username not specified.");
alertLogout.setPositiveButton("Ok", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertLogout.show();
}