你如何传递数据/参数到Android的另一个活动参数、数据、Android

由网友(﹏樱花 祭)分享简介:如何将数据/参数值传递从一个活动到另一个机器人?How to pass data/parameter values from one activity to another in android?我已经用loginname=txtloginname.getText().toString();password=t...

如何将数据/参数值传递从一个活动到另一个机器人?

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

我已经用

loginname=txtloginname.getText().toString();
password=txtpassword.getText().toString();
Bundle bundle = new Bundle();
bundle.putString("loginname", loginname);
bundle.putString("password", password);
Intent newIntent=new Intent();
newIntent.putExtras(bundle);
setResult(RESULT_OK,newIntent);
finish();

但我只能得到登录名值如何将登录和密码键和值?

But I can only get loginname value How to put both login and password key and value?

推荐答案

您可以只是说 newIntent.putExtra(名,值); 用它多次添加多个数据。并根据这些数据,您储存来电 getStringExtra(姓名); 在接下来的活动

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.

阅读全文

相关推荐

最新文章