当前位置: 首页>>代码示例>>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;未经允许,请勿转载。