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


Java GetCallback類代碼示例

本文整理匯總了Java中com.parse.GetCallback的典型用法代碼示例。如果您正苦於以下問題:Java GetCallback類的具體用法?Java GetCallback怎麽用?Java GetCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GetCallback類屬於com.parse包,在下文中一共展示了GetCallback類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getEventData

import com.parse.GetCallback; //導入依賴的package包/類
public void getEventData(final ICardCallback<ILobbyEventCard> callback) {
    ParseQuery<LobbyEventCard> query = ParseQuery.getQuery(LobbyEventCard.class);
    query.getInBackground(Constans.PARSE_EVENT_OBJECT_ID, new GetCallback<LobbyEventCard>() {
        @Override
        public void done(LobbyEventCard object, ParseException e) {
            if (e == null) {
                callback.onSuccess(false, object);
            } else {
                callback.onError(e);
            }
        }
    });
}
 
開發者ID:bvblogic,項目名稱:Mediator_Android,代碼行數:14,代碼來源:NetWrapper.java

示例2: retreiveprofile

import com.parse.GetCallback; //導入依賴的package包/類
public static void retreiveprofile(String username , final Context context) {
    ParseQuery<ParseObject> query= ParseQuery.getQuery("Profile");
    query.whereEqualTo("user",username);
    query.getFirstInBackground(new GetCallback<ParseObject>() {
        @Override
        public void done(ParseObject parseObject, ParseException e) {

            if(parseObject!=null && e==null) {

                ParseFile file = (ParseFile) parseObject.get("image");
                String url = "http://wwww.webianks.com";

                if (file != null) {
                    url = file.getUrl().toString();
                }

                MainActivity.retriveProfileCallback(context, url);

            }else{
                //canntretrivee file
            }
        }
    });

}
 
開發者ID:salRoid,項目名稱:Clasick,代碼行數:26,代碼來源:DisplayImage.java

示例3: retreivetimelineprofile

import com.parse.GetCallback; //導入依賴的package包/類
public static void retreivetimelineprofile(String username , final Context context) {
    ParseQuery<ParseObject> query= ParseQuery.getQuery("Profile");
    query.whereEqualTo("user",username);
    query.getFirstInBackground(new GetCallback<ParseObject>() {
        @Override
        public void done(ParseObject parseObject, ParseException e) {

            if(parseObject!=null && e==null) {

                ParseFile file = (ParseFile) parseObject.get("image");
                String url = "http://wwww.webianks.com";
                if (file != null) {

                    url = file.getUrl().toString();
                }

                Profile.retriveTimelineProfileCallback(context, url);

            }else{
                //canntretrivee file
            }
        }
    });

}
 
開發者ID:salRoid,項目名稱:Clasick,代碼行數:26,代碼來源:DisplayImage.java

示例4: addCommentTask

import com.parse.GetCallback; //導入依賴的package包/類
public void addCommentTask(){
    ParseQuery<ParseObject> query = ParseQuery.getQuery("BullshITBankDB");
    query.whereEqualTo("phone", Phone);
    query.getFirstInBackground(new GetCallback<ParseObject>() {
        @Override
        public void done(ParseObject parseObject, ParseException e) {
            Log.d("TAG","Done Loading Detail!");
            String NewComment = AddComment.getText().toString();
            List<String> CommentsList = parseObject.getList("comments");
            if(CommentsList==null){
                CommentsList = new ArrayList<String>();
            }
            CommentsList.add(NewComment+"["+GUID+"]");
            parseObject.put("comments",CommentsList);
            parseObject.saveInBackground();
            loadDetail();
        }
    });
}
 
開發者ID:sukso96100,項目名稱:BullshIT-DB_Android,代碼行數:20,代碼來源:DetilActivity.java

示例5: addCommentTask

import com.parse.GetCallback; //導入依賴的package包/類
public void addCommentTask(String Number, final String Comment, final String GUID){
    ParseQuery<ParseObject> query = ParseQuery.getQuery("BullshITBankDB");
    query.whereEqualTo("phone", Number);
    query.getFirstInBackground(new GetCallback<ParseObject>() {
        @Override
        public void done(ParseObject parseObject, ParseException e) {
            Log.d("TAG", "Done Loading Detail!");
            List<String> CommentsList = parseObject.getList("comments");
            if(CommentsList==null){
                CommentsList = new ArrayList<String>();
            }
            CommentsList.add(Comment+"["+GUID+"]");
            parseObject.put("comments",CommentsList);
            parseObject.saveInBackground();
        }
    });
}
 
開發者ID:sukso96100,項目名稱:BullshIT-DB_Android,代碼行數:18,代碼來源:AddNewConfirmDialog.java

示例6: initData

import com.parse.GetCallback; //導入依賴的package包/類
private void initData() {
    String id = getArguments().getString(USER_ID);
    mState = getArguments().getString(Constants.CATEGORY);

    if (id != null && mState != null) {
        QueryHelper.getUserById(id, new GetCallback<User>() {
            @Override
            public void done(User user, ParseException e) {
                if (e == null) {
                    mUser = user;

                    mUserQueryAdapter = new UserQueryAdapter(getActivity(), null, mState, mUser);
                    setListAdapter(mUserQueryAdapter);
                } else {
                    NotificationHelper.alert(getActivity(),
                            getString(R.string.dialog_error_title),
                            e.getMessage());
                }
            }
        });
    }
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:23,代碼來源:FollowFragment.java

示例7: onResume

import com.parse.GetCallback; //導入依賴的package包/類
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onResume() {
    super.onResume();

    mPivBigAvatar.setParseFile(mUser.getAvatar());

    if (mUser.getAvatar() != null) {
        mPivBigAvatar.loadInBackground();
    } else {
        mPivBigAvatar.setBackground(getResources().getDrawable(R.drawable.ic_avatar));
    }

    if (mMyRoom != null) {
        mMyRoom.fetchIfNeededInBackground(new GetCallback<ParseObject>() {
            @Override
            public void done(ParseObject room, ParseException e) {
                if (e == null) {
                    mRiMyRoom.setData(LocalDb.getInstance().getCurrentUser(), mMyRoom);
                }
            }
        });
    }

    setRoomUIElementsVisibility();
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:27,代碼來源:ProfileFragment.java

示例8: setData

import com.parse.GetCallback; //導入依賴的package包/類
public void setData(User user) {
    mSelectedUser = user;

    mSelectedUser.fetchIfNeededInBackground(new GetCallback<ParseObject>() {
        @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
        @Override
        public void done(ParseObject parseObject, ParseException e) {
            mTvUsername.setText(mSelectedUser.getUsername());
            mPivAvatar.setParseFile(mSelectedUser.getAvatar());

            if (mSelectedUser.getAvatar() != null) {
                mPivAvatar.loadInBackground();
            } else {
                mPivAvatar.setBackground(getResources().getDrawable(R.drawable.ic_avatar));
            }

            if (!mCurrentUser.equals(mSelectedUser)) {
                mFbFollow.setData(mCurrentUser, mSelectedUser);
            }
        }
    });
}
 
開發者ID:tl-nguyen,項目名稱:RadarApp,代碼行數:23,代碼來源:UserItem.java

示例9: setUsersImageToParse

import com.parse.GetCallback; //導入依賴的package包/類
public void setUsersImageToParse(String username, final File image){
    ParseQuery<ParseUser> query = ParseUser.getQuery();
    query.whereEqualTo("username", username);

    query.getFirstInBackground(new GetCallback<ParseUser>() {
        public void done(ParseUser UsersClass, ParseException e) {
            if (UsersClass == null) {
                Log.d("score", "no success setUsersImageToParse");
            } else {
                //success
                UsersClass.put("ProfilePic", image);
                UsersClass.saveInBackground();

                pullParseAndSetOtherUsersDatainBackground();

            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:20,代碼來源:ParseDatabase.java

示例10: delete

import com.parse.GetCallback; //導入依賴的package包/類
public void delete(final String id) {
	ParseQuery<ParseObject> query = ParseQuery.getQuery("Slice");
	if (!NetworkStatus.isConnected)
		query.fromLocalDatastore();
	
	query.whereEqualTo("UUID", "" + id);
	query.getFirstInBackground(new GetCallback<ParseObject>() {
		public void done(ParseObject parseSlice, ParseException e) {
			if (parseSlice == null) {
				
				Log.i("Slice", "Deleted: The getFirst request failed.");
			} else {
				Log.i("Slice", "Slice " + id + " is deleted");
				parseSlice.put("deleted", true);
				parseSlice.pinInBackground();
				parseSlice.saveInBackground();
			}
		}
	});
}
 
開發者ID:maxml,項目名稱:AutoTimeHelper,代碼行數:21,代碼來源:SliceCRUD.java

示例11: read

import com.parse.GetCallback; //導入依賴的package包/類
public void read(String UUID, ParseObject parseLine, final List<Slice> sliceList) {
	ParseQuery<ParseObject> query = ParseQuery.getQuery("Point");
	if (!NetworkStatus.isConnected)
		query.fromLocalDatastore();
	
	query.whereEqualTo("UUID", UUID);
	query.getFirstInBackground(new GetCallback<ParseObject>() {
		public void done(ParseObject parsePoint, ParseException e) {
			if (parsePoint == null) {
				Log.i("Point", "Read: The getFirst request failed.");
			} else {
				// try {
				Log.i("Point", "Starting read");
				// parsePoint.fetch();
				Point point = new Point(parsePoint.getDouble("x"), parsePoint.getDouble("y"));
				point.setObjectId(parsePoint.getString("UUID"));
				onresult.onResult(point, sliceList);
				// } catch (ParseException e1) {
				// Log.d("Point", "Read: object not nul, but" + e1);
				// e1.printStackTrace();
				// }
				
			}
		}
	});
}
 
開發者ID:maxml,項目名稱:AutoTimeHelper,代碼行數:27,代碼來源:PointCRUD.java

示例12: getCurrentUserId

import com.parse.GetCallback; //導入依賴的package包/類
private void getCurrentUserId(String phoneNumber) {
    ParseQuery<ParseObject> query = ParseQuery.getQuery("SimpleUser");
    query.whereEqualTo("phone_number", phoneNumber);
    query.getFirstInBackground(new GetCallback<ParseObject>(){
        public void done(ParseObject object, ParseException e) {
        if (e == null) {
            String userId = object.getObjectId().toString();
            String currentUserObjId = userId;
            SimpleUser.currentUserObjectId = currentUserObjId;
            // Write the userId in shared pref if the user successfully signed up
            SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            SharedPreferences.Editor edit = pref.edit();
            edit.putString("userId", userId);
            edit.commit();

            Intent returnIntent = new Intent();
            setResult(RESULT_OK, returnIntent);
            finish();
            overridePendingTransition(R.anim.stay_in_place, R.anim.exit_to_bottom);
        } else {
            Log.d("DEBUG", "Error: " + e.getMessage());
        }
        }

    });
}
 
開發者ID:fitness-buddy,項目名稱:Fitness-Buddy-Group-Project,代碼行數:27,代碼來源:PhoneNoVerificationActivity.java

示例13: populateFavoriteTrainers

import com.parse.GetCallback; //導入依賴的package包/類
public void populateFavoriteTrainers() {
    showProgressWheel();
    final TrainersListFragment finalFragment = fragment;
    String currentUserId = getLoggedInUserId();

    // If userId is found; user has already signed up
    if (!currentUserId.equals("")) {

        ParseQuery<SimpleUser> query = ParseQuery.getQuery("SimpleUser");
        query.whereEqualTo("objectId", currentUserId);
        query.getFirstInBackground(new GetCallback<SimpleUser>() {
            @Override
            public void done(SimpleUser simpleUser, ParseException e) {
                SimpleUser.currentUserObject = simpleUser;
                showFavorites();
            }
        });
    } else {
        // Ask the user to sign up
        launchLoginActivity(LOGIN_FOR_FAVORITES);
    }
}
 
開發者ID:fitness-buddy,項目名稱:Fitness-Buddy-Group-Project,代碼行數:23,代碼來源:HomeActivity.java

示例14: insertStockImage

import com.parse.GetCallback; //導入依賴的package包/類
void insertStockImage(String imageId, ImageView ivImage) {
    ivImage.setBackgroundColor(R.color.gray7);
    ParseQuery<StockImage> query = ParseQuery.getQuery(StockImage.class);
    final ImageView ivImageRef = ivImage;
    final String iid = imageId;
    Log.d("DEBUG", "Fetching StockImage " + imageId + " for ImageView " + ivImageRef);
    query.getInBackground
        (imageId,
         new GetCallback<StockImage>() {
            public void done(StockImage sImage, ParseException e) {
                if (e == null) {
                    Log.d("DEBUG", "Callback for StockImage " + sImage.getObjectId() +
                          " (expected " + iid + ") and ImageView " + ivImageRef);
                    if (ivImageRef.getTag().equals(sImage.getObjectId())) {
                        setImageFile(sImage, ivImageRef);
                    } else {
                        Log.d("DEBUG", "stale callback for " + sImage.getObjectId() + "; "
                              + "Image " +ivImageRef  + " is now "  + ivImageRef.getTag());
                    }
                } else {
                    Log.d("ERROR", "erp! " + e);
                }
            }
        });
}
 
開發者ID:samv,項目名稱:AshaNetApp,代碼行數:26,代碼來源:StreamAdapter.java

示例15: getOrFetchUser

import com.parse.GetCallback; //導入依賴的package包/類
public static void getOrFetchUser(final long userId, final Async.Block<User> completion) {
	if (User.getUser(userId) != null) {
		if (completion != null) {
			completion.call(User.getUser(userId));
		}
	} else {
		getUser(userId, new GetCallback<User>() {
			@Override
			public void done(User user, ParseException e) {
				user.putInCache();
				if (completion != null) {
					completion.call(e == null ? user : null);
				}
			}
		});
	}
}
 
開發者ID:WomenWhoCode,項目名稱:MentorMe,代碼行數:18,代碼來源:DataService.java


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