I am new to AsyncTask:
I want that whenever the user gets 'login success
' the user will get alert with Ok, and when this Ok is clicked then the user should go to Activity2
screen.
I am unable to do this. Please help. Below is the code:
@Override
protected void onPostExecute(String result) {
alertDialog.setMessage(result);
if(result.equals("login success")) {
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setContentView(R.layout.activity_main2);
}
});
} else {
}
alertDialog.show();
}