本文整理匯總了Java中com.parse.ParseQuery.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseQuery.get方法的具體用法?Java ParseQuery.get怎麽用?Java ParseQuery.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.parse.ParseQuery
的用法示例。
在下文中一共展示了ParseQuery.get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initData
import com.parse.ParseQuery; //導入方法依賴的package包/類
private void initData() {
String id = getArguments().getString(USER_ID);
mLocalDb = LocalDb.getInstance();
mUser = mLocalDb.getCurrentUser();
mFollow = mUser.getFollow();
mIsCurrentUser = id == null || mUser.getObjectId().equals(id);
if (!mIsCurrentUser) {
ParseQuery query = new ParseQuery(Constants.USER_TABLE);
try {
mUser = (User) query.get(id);
mFollow = mUser.getFollow();
} catch (ParseException e) {
NotificationHelper.alert(getActivity(),
getString(R.string.dialog_error_title),
e.getMessage());
}
}
mMyRoom = mUser.getRoom();
}
示例2: onCreate
import com.parse.ParseQuery; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_attendance);
//code to get intent
isEditing = getIntent().getBooleanExtra("isEditing",false);
intentAttendance = getIntent().getStringArrayExtra("intentAttendance");
intentDate = getIntent().getStringExtra("intentDate");
intentAttendanceId = getIntent().getStringExtra("intentAttendanceId");
//code for adding the home arrow to actionBar
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
if(isEditing){
actionBar.setTitle("Edit attendance");
}else{
actionBar.setTitle("Add attendance");
}
//code for connecting views
dateText = (EditText) findViewById(R.id.attendanceDate);
listView = (ListView) findViewById(R.id.kidsAttendanceList);
//if editing attendance we should find the date existing
if(isEditing){
dateText.setText(intentDate);
//also getting the attendance with the specified id from intent
ParseQuery<Attendance> singleAttendanceQuery = ParseQuery.getQuery(Attendance.class);
try {
attendance = singleAttendanceQuery.get(intentAttendanceId);
} catch (ParseException e) {
e.printStackTrace();
}
}else{ // but if we are not editing we should initialize an attendance object anyway for later saving
attendance = new Attendance();
}
//Initializing the kidArrayList and updating data in it
kidArrayList = new ArrayList<>();
localQuery();
}