android switch to activity code example
Example 1: android how to switch between activities
Intent intent = new Intent(getApplicationContext(), ActivityToBeOpened.class);
startActivity(intent);
Example 2: navigate to another activity in android
OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(action));
}
};
Button button = (Button) findViewById(id);
button.setOnClickListener(onClickListener);