本文整理匯總了Java中com.parse.ParseUser.getQuery方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseUser.getQuery方法的具體用法?Java ParseUser.getQuery怎麽用?Java ParseUser.getQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.parse.ParseUser
的用法示例。
在下文中一共展示了ParseUser.getQuery方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUsersImageToParse
import com.parse.ParseUser; //導入方法依賴的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();
}
}
});
}
示例2: signup
import com.parse.ParseUser; //導入方法依賴的package包/類
private void signup(String usernametxt, String passwordtxt) {
if (!isEmpty()){
int numberParse = 0;
ParseQuery<ParseUser> numberofUsers = ParseUser.getQuery(); // Note to myself : count users in parse class
try {
numberParse=numberofUsers.count();
} catch (ParseException e1) {
e1.printStackTrace();
}
user = new ParseUser();
user.setUsername(usernametxt);
user.setPassword(passwordtxt);
user.put("userID",numberParse+1);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
checkSignup(e);
}
});
}
}
示例3: openConversation
import com.parse.ParseUser; //導入方法依賴的package包/類
public void openConversation(ArrayList<String> names, int pos) {
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereEqualTo("username", names.get(pos));
query.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> user, com.parse.ParseException e) {
if (e == null) {
Intent intent = new Intent(getApplicationContext(), MessagingActivity.class);
intent.putExtra("RECIPIENT_ID", user.get(0).getObjectId());
startActivity(intent);
} else {
Toast.makeText(getApplicationContext(),
"Error finding that user",
Toast.LENGTH_SHORT).show();
}
}
});
}
示例4: updateName
import com.parse.ParseUser; //導入方法依賴的package包/類
public void updateName(final String name, final String id) {
Log.d("UserAPI", "start updateName");
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereEqualTo(USERNAME, ParseUser.getCurrentUser().getUsername());
query.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> objects, ParseException e) {
if (e == null) {
for (ParseUser parseUser : objects) {
Log.d("UserAPI", "find object");
if (parseUser.getObjectId().equals(id)) {
Log.d("UserAPI", "found, rename");
ParseUser.getCurrentUser().put(USERNAME, name);
}
}
} else {
Log.d("UserAPI", "problem in updateName");
e.printStackTrace();
}
}
});
}
示例5: updateEmail
import com.parse.ParseUser; //導入方法依賴的package包/類
public void updateEmail(final String email, final String id) {
Log.d("UserAPI", "start updateEmail");
ParseQuery<ParseUser> queryOne = ParseUser.getQuery();
queryOne.whereEqualTo(EMAIL, email);
queryOne.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> objects, ParseException e) {
if (e == null) {
for (ParseUser parseUser : objects) {
if (parseUser.getObjectId().equals(id)) {
ParseUser.getCurrentUser().put(EMAIL, email);
}
}
} else {
Log.d("UserAPI", "problem in updateEmail");
e.printStackTrace();
}
}
});
}
示例6: onCreateView
import com.parse.ParseUser; //導入方法依賴的package包/類
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Profile activity = (Profile) getActivity();
String selected_user = activity.sendmydata();
View view = inflater.inflate(R.layout.activity_timeline, container, false);
timeline_user_email = (TextView) view.findViewById(R.id.tv_usermail);
timeline_question_count = (TextView) view.findViewById(R.id.question_count);
timeline_designation = (TextView) view.findViewById(R.id.tv_timeline_desig);
timeline_usernmae = (TextView) view.findViewById(R.id.set_user_orignalname);
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereEqualTo("username", selected_user);
query.getFirstInBackground(new GetCallback<ParseUser>() {
@Override
public void done(ParseUser parseUser, ParseException e) {
if (e == null) {
user_name = parseUser.getString("Name");
user_desig = parseUser.getString("who");
user_email = parseUser.getEmail();
user_question_count = parseUser.get("query_count").toString();
timeline_usernmae.setText(user_name);
timeline_designation.setText(user_desig);
timeline_user_email.setText(user_email);
timeline_question_count.setText(user_question_count);
} else {
}
}
});
return view;
}
示例7: notifySOS
import com.parse.ParseUser; //導入方法依賴的package包/類
public void notifySOS() {
Log.d("AcceptedSOS","notifying");
// Find users near a given location
ParseQuery<ParseUser> userQuery = ParseUser.getQuery();
userQuery.whereEqualTo("username", senderId);
// Find devices associated with these users
ParseQuery<ParseInstallation> pushQuery = ParseInstallation.getQuery();
pushQuery.whereMatchesQuery("user", userQuery);
JSONObject jo = new JSONObject();
try {
jo.put("title", "Someone is coming to help you!");
jo.put("alert", "Ya! I'm coming!");
jo.put("sosId", SOSid);
jo.put("chatChannel", channelId);
jo.put("username", ParseUser.getCurrentUser().getUsername());
jo.put("type", "helping");
jo.put("displayname", displayname);
} catch (JSONException e) {
e.printStackTrace();
}
// Send push notification to query
ParsePush push = new ParsePush();
push.setQuery(pushQuery); // Set our Installation query
push.setData(jo);
push.sendInBackground();
}
示例8: getUsersIn
import com.parse.ParseUser; //導入方法依賴的package包/類
public static void getUsersIn(List<String> ids, final UserDataCallbacks callbacks) {
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereContainedIn(COLUMN_ID, ids);
query.findInBackground(new FindCallback<ParseUser>() {
@Override
public void done(List<ParseUser> list, ParseException e) {
formatCallback(list, e, callbacks);
}
});
}
示例9: doneFetchingUserInterests
import com.parse.ParseUser; //導入方法依賴的package包/類
public void doneFetchingUserInterests(ArrayList<ParseObject> currentUserInterestsList) {
existingElement.clear();
if (currentUserInterestsList != null && !currentUserInterestsList.isEmpty())
{
for (int c = 0; c < currentUserInterestsList.size(); c++) {
if (!currentUserInterestsList.get(c).equals("") || !(currentUserInterestsList.get(c) == null)) {
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);
query.include(ParseTables.Users.INTERESTS);
query.include(ParseTables.Users.INSTITUTE);
query.whereEqualTo(ParseTables.Users.INTERESTS, currentUserInterestsList.get(c));
query.findInBackground(new FindCallback<ParseUser>() {
public void done(final List<ParseUser> objects, ParseException e) {
if (e == null) {
doneFetchingPeople(objects);
} else {
// Something went wrong.
}
}
});
}
}
} else
{
progressBar.setVisibility(View.GONE);
}
}
示例10: initiateChannels
import com.parse.ParseUser; //導入方法依賴的package包/類
private void initiateChannels() {
//create new channels to parse only if the user is new
//get the object id now and save it for future use
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereEqualTo("email", Profiles.getInstance().loginEmail);
//check if email already existed in database
query.getFirstInBackground(new GetCallback<ParseUser>() {
public void done(ParseUser object, ParseException e) {
if (object == null) {
//get the object id now and save it for future uses
setMyChannelObjectId(object.getObjectId());
object.put("channels", "");
object.saveInBackground();
} else {
//already exists
//get the object id now and save it for future uses
setMyChannelObjectId(object.getObjectId());
//set the subscribed channels list locally
String channelList = object.getString("channels");
MyChannels subscriptionList = MyChannels.getInstance();
subscriptionList.initiateLocalChannelsList(channelList);
Log.d("score", "subscription list updated");
}
}
});
}
示例11: UpdateChannelsToParse
import com.parse.ParseUser; //導入方法依賴的package包/類
public void UpdateChannelsToParse(final String HashMapStrings) {
ParseQuery<ParseUser> query = ParseUser.getQuery();
// Retrieve the object by id
query.getInBackground(getMyChannelObjectId(), new GetCallback<ParseUser>() {
public void done(ParseUser ParseChannels, ParseException e) {
if (e == null) {
MyChannels list = MyChannels.getInstance();
//we are just gonna update the string
ParseChannels.put("channels", HashMapStrings);
ParseChannels.saveInBackground();
}
}
});
}
示例12: checkUsername
import com.parse.ParseUser; //導入方法依賴的package包/類
/**
* First, this method calls isUsernameValid(). If the username is valid, we then check if
* it is already taken.
*
* @param username The username to check
*
* @return "OK" if the username checks out. Error message otherwise.
*/
private String checkUsername(String username){
// First, check constraints in isUserNameValid()
StringBuilder temp = new StringBuilder();
if(!isUsernameValid(username, temp)){
return temp.toString();
}
// If the query hasn't already been canceled, start the query.
if(!queryCanceled){
// Next, check if the username is taken
query = ParseUser.getQuery();
query.whereEqualTo("username", username);
try {
if (query.find().size() > 0) {
// Username is taken.
return "Username is taken";
} else{
// User name is not taken
return "OK";
}
} catch(ParseException e){
return "Unable to check username";
}
} else{
return "Unable to check username";
}
// This line is unreachable.
}
示例13: pullParseAndSetOtherUsersDatainBackground
import com.parse.ParseUser; //導入方法依賴的package包/類
public void pullParseAndSetOtherUsersDatainBackground() {
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.findInBackground(new FindCallback<ParseUser>() {
public void done(List<ParseUser> objects, ParseException e) {
if (e == null) {
// The query was successful.
updateOtherUsersData(objects);
} else {
//failed
}
}
});
}
示例14: TopCommentsAdapter
import com.parse.ParseUser; //導入方法依賴的package包/類
public TopCommentsAdapter(Context context, List<ParseObject> myWubbleDataSet, ArrayList<String> myUserDataSet, int movieId) {
myWubbles = myWubbleDataSet;
ParseQuery userQuery = ParseUser.getQuery();
try {
mUserList = (ArrayList<ParseUser>) userQuery.find();
} catch (ParseException e) {
e.printStackTrace();
}
myContext = context;
layoutInflater = LayoutInflater.from(myContext);
}
示例15: FollowingCommentsAdapter
import com.parse.ParseUser; //導入方法依賴的package包/類
public FollowingCommentsAdapter(Context context, List<ParseObject> myWubbleDataSet, ArrayList<String> myUserDataSet, int movieId) {
myWubbles = myWubbleDataSet;
ParseQuery userQuery = ParseUser.getQuery();
userQuery.whereContainedIn("username", myUserDataSet);
try {
mUserList = (ArrayList<ParseUser>) userQuery.find();
} catch (ParseException e) {
e.printStackTrace();
}
myContext = context;
layoutInflater = LayoutInflater.from(myContext);
}