My Application have 5 activities(A1,A2,A3,A4,A5). Each activity have one text view and one button(B1,B2,B3,B4,B5). If you click on that button then goes to next activity. su
You can also do logout by starting the LoginActivity. Example is shown below and is for when you select the Log Out button in the menu.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case R.id.action_logout:
LoginActivity.username.setText("");
LoginActivity.password.setText("");
Intent logout = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(logout);
return true;
}
}