Skip to content
Advertisement

How to navigate from one screen to another screen

How to navigate from one Activity screen to another Activity screen? In the first screen I’m having one button if I click the button it has to move to another Activity screen.

Advertisement

Answer

OnClickListener onClickListener = new OnClickListener() {
    @Override
    public void onClick(View v) {
        startActivity(new Intent(action));
    }
};

Button button = (Button) findViewById(id);
button.setOnClickListener(onClickListener);
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement