我在一个活动中创建了一个表单(此表单包含一些文本视图和编辑文本字段)。 一旦我填写表格,说我接受并点击提交按钮我应该得到一个新屏幕,其中包含我填写的所有字段并请求我确认。单击确认按钮后,它应该在另一个活动/屏幕中结束。有人能帮助我吗?
谢谢(提前) Swetha
答案 0 :(得分:1)
您可以使用Intent传递原始数据(如字符串等),如下所示
String fName_temp = "aaa";
String lName_temp = "ccc";
String age_temp = "12";
String address_temp = "test Address";
Intent i = new Intent(this, ToClass.class);
i.putExtra("fname", fName_temp);
i.putExtra("lname", lName_temp);
i.putExtra("age", age_temp);
i.putExtra("address", address_temp);
startActivity(i);
然后在第二个活动中,您可以使用
获得上述意图Intent i = getIntent();
String fName = i.getString("fname");
等