我在onCreate中设置了两个textview,如下所示;
tv1.setText("john");
tv2.setText("smithh");
为什么这样做:
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> parameters = new HashMap<String,String>();
parameters.put("param1", "John");
parameters.put("param2", "Smith");
return parameters;
}
但不是这样:
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> parameters = new HashMap<String,String>();
String myID1 = tv1.getText().toString();
String myID2 = tv2.getText().toString();
parameters.put("param1", myID1);
parameters.put("param2", myID2);
return parameters;
}
如何解决这个问题,请将变量发布到创建Json的PHP代码中?