How to switch between screens?

后端 未结 6 1215
梦如初夏
梦如初夏 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:08

    For moving from one Activity to another Activity, you need to use Intent.

    For example, you are having one activity "A" contains button and second activity "B", and you want to move from "A" to "B" then write:

    Intent intent = new Intent(A.this, B.class);
    startActivity(intent);
    

    Practical and informative examples for the Intent are here: Android Intents - Tutorial

提交回复
热议问题