在parse.com数据库中只添加了一个字段(Only one field is getting added in parse.com database)
只有最后一个字段才能保存在parse.com数据库中,任何人都可以告诉我为什么? 数据库仅保存具有地名“GE”的字段,并忽略第一个输入的数据!
ParseObject testObject = new ParseObject("locations"); ParseGeoPoint point = new ParseGeoPoint(21.177051,79.061818); //1 testObject.put("placeName", "Brand Factory"); testObject.put("address","Brand Factory,RKNEC,Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "10% on Clothing"); testObject.saveInBackground(); //2 point = new ParseGeoPoint(21.177161,79.060533); testObject.put("placeName", "G E"); testObject.put("address","G E, RKNEC, Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "20% on Shoes"); testObject.saveInBackground()Only last field in getting saved in the parse.com database, can any one tell me why? Database only saves the field with place name "G E" and ignores the first inputted data!
ParseObject testObject = new ParseObject("locations"); ParseGeoPoint point = new ParseGeoPoint(21.177051,79.061818); //1 testObject.put("placeName", "Brand Factory"); testObject.put("address","Brand Factory,RKNEC,Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "10% on Clothing"); testObject.saveInBackground(); //2 point = new ParseGeoPoint(21.177161,79.060533); testObject.put("placeName", "G E"); testObject.put("address","G E, RKNEC, Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "20% on Shoes"); testObject.saveInBackground()最满意答案
我认为Parse简单地覆盖你的地方字段。 使用ParseObject testObject = new ParseObject("locations"); 每次投入新价值之前:
//1 ParseObject testObject1 = new ParseObject("locations"); ParseGeoPoint point1 = new ParseGeoPoint(21.177051,79.061818); testObject1.put("placeName", "Brand Factory"); testObject1.put("address","Brand Factory,RKNEC,Nagpur"); testObject1.put("locationPoint", point1); testObject1.put("offers", "10% on Clothing"); testObject1.saveInBackground(); //2 ParseObject testObject2 = new ParseObject("locations"); ParseGeoPoint point2 = new ParseGeoPoint(21.177051,79.061818); testObject2.put("placeName", "G E"); testObject2.put("address","G E, RKNEC, Nagpur"); testObject2.put("locationPoint", point2); testObject2.put("offers", "20% on Shoes"); testObject2.saveInBackground()I think Parse simple overwrite your place fields. Use ParseObject testObject = new ParseObject("locations"); every time before put new values:
//1 ParseObject testObject1 = new ParseObject("locations"); ParseGeoPoint point1 = new ParseGeoPoint(21.177051,79.061818); testObject1.put("placeName", "Brand Factory"); testObject1.put("address","Brand Factory,RKNEC,Nagpur"); testObject1.put("locationPoint", point1); testObject1.put("offers", "10% on Clothing"); testObject1.saveInBackground(); //2 ParseObject testObject2 = new ParseObject("locations"); ParseGeoPoint point2 = new ParseGeoPoint(21.177051,79.061818); testObject2.put("placeName", "G E"); testObject2.put("address","G E, RKNEC, Nagpur"); testObject2.put("locationPoint", point2); testObject2.put("offers", "20% on Shoes"); testObject2.saveInBackground()更多推荐
发布评论