本文整理汇总了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();
}