2014-05-23 27 views
0

我有下面的代碼爲什麼註釋2不獲取發送到數據瀏覽器

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個客戶對象,但它不會去。可以讓任何人幫我嗎?

回答

1

我想你不應該把值放在列中哪個名字包含空格,就像電話號碼,拾起位置一樣。嘗試把一個下劃線,而不是(雲碼側),所以儘量把值在該領域(Phone_NumberPick_Up_Location

+0

是的,這是一個重點......但問題是我沒有正確添加密鑰..反正 –

相關問題