How to start new activity on button click

后端 未结 24 2249
傲寒
傲寒 2020-11-21 05:54

In an Android application, how do you start a new activity (GUI) when a button in another activity is clicked, and how do you pass data between these two activities?

24条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-21 06:39

    The way to start new activities is to broadcast an intent, and there is a specific kind of intent that you can use to pass data from one activity to another. My recommendation is that you check out the Android developer docs related to intents; it's a wealth of info on the subject, and has examples too.

提交回复
热议问题