How do you pass data/parameters to another activity in Android

前端 未结 2 1168
心在旅途
心在旅途 2021-01-25 09:29

How to pass data/parameter values from one activity to another in android?

I have used

loginname=txtloginname.getText().toString();
password=txtpassword         


        
相关标签:
2条回答
  • 2021-01-25 09:45

    You can just say newIntent.putExtra("name",value); use it multiple times to add multiple data. And depending on the data you stored call getStringExtra("name"); in the next activity.

    0 讨论(0)
  • 2021-01-25 09:55

    You can use the method:

    getStringExtra()
    
    0 讨论(0)
提交回复
热议问题