當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseQuery.get方法代碼示例

本文整理匯總了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();
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:26,代碼來源:ProfileFragment.java

示例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();









}
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:51,代碼來源:AddAttendance.java


注:本文中的com.parse.ParseQuery.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。