@Override
protected void onPostExecute(String result) {
alertDialog.setMessage(result);
alertDialog.show();
if(result.contains("login success")){
Intent intent = new Intent(context, Viewlpost.class);
context.startActivity(intent);
}
}
This is my code, to redirect the user from loginactiivty to a fragment activity
This syntax won't work because the application crashes after doing the intent.
I also need a button inside a fragment that needs to redirect to another fragment when clicked. Account to edit account. This is the code
changepword.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
Intent intent = new Intent(getActivity(),EditAccount.class);
startActivity(intent);
}
});