我有以下代码
public class Destination extends Activity {
EditText destinationPoint;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_destination);
destinationPoint=(EditText)findViewById(R.id.dest);
Parse.initialize(this, "cccc", "xxxx");
ParseObject ob=new ParseObject("vamsi"); //1
ob.put("vamsi"," pavan"); //1
ob.saveInBackground(); //1
}
public void ridenow(View view){
SharedPreferences sharedPreferences =getSharedPreferences("AutoRaja",Context.MODE_PRIVATE);
SharedPreferences.Editor edit=sharedPreferences.edit();
edit.putString("destination", destinationPoint.getText().toString());
edit.commit();
String name=sharedPreferences.getString("customerName", "mr x");
Log.d("name",name);
String phoneNumber=sharedPreferences.getString("customerNumber", "0000000000");
Log.d("phone",phoneNumber);
String pickup=sharedPreferences.getString("pick", null);
Log.d("pickup",pickup);
String destination=sharedPreferences.getString("destination", null);
Log.d("destination",destination);
ParseObject customerDetails = new ParseObject("Customer"); //2
customerDetails.put("Name", name); //2
customerDetails.put("Phone Number",phoneNumber); //2
customerDetails.put("Pick Up Location", pickup); //2
customerDetails.put("Destination",destination ); //2
customerDetails.saveInBackground(); //2
ParseObject ob=new ParseObject("gates"); //3
ob.put("mill"," billionire"); //3
ob.saveInBackground(); //3
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.destination, menu);
return true;
}
}
所以在上面的代码中,我能够将// 1和// 3对象发送到parse.com中的数据浏览器,但这对我来说没用。我需要发送// 2客户对象,但是它不会去。可以帮助我吗?
答案 0 :(得分:1)
我想你不应该把值放在名称中包含空格的列中,所以就像电话号码,取货地点一样。尝试使用下划线(云代码侧),因此请尝试将值放在该字段中(Phone_Number
,Pick_Up_Location
)