How to switch between screens?

后端 未结 6 1237
梦如初夏
梦如初夏 2020-12-31 20:37

I\'m new in the android develop world. I created simple application and created a simple GUI with one button. If the user presses this button, I want to change the screen

6条回答
  •  星月不相逢
    2020-12-31 21:12

    Set the button's onClick to a method that uses Intent.

    XML:

    
    

    Java method:

    public void to_different_page(View view) {
        Intent intent = new Intent(this, browse_post_activity.class);
        startActivity(intent);
    }
    

提交回复
热议问题