I have the following code which is executed once the user clicks a button
public void logout(){
// redirect user back to login screen activity
Intent i = new Intent(this, LoginActivity.class);
// Closing all the Activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// Add new Flag to start new Activity
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// start Login Activity
startActivity(i);
}
However each time the button is clicked, the emulator crashes. Any ideas what i might be doing wrong?
The issue was prior to this method being called. I was trying to set the text on an EditText item that was part of another layout