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


Java ParseUser.getQuery方法代碼示例

本文整理匯總了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();

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

示例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);
            }
        });
    }
}
 
開發者ID:safakesberk,項目名稱:Cloud_Base-To-Do-App,代碼行數:22,代碼來源:LoginSignupActivity.java

示例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();
           }
       }
    });
}
 
開發者ID:Paulocajr,項目名稱:IPRJapp,代碼行數:18,代碼來源:ListUsersActivity.java

示例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();
			}
		}
	});
}
 
開發者ID:maxml,項目名稱:AutoTimeHelper,代碼行數:22,代碼來源:UserAPI.java

示例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();
			}
		}
	});
}
 
開發者ID:maxml,項目名稱:AutoTimeHelper,代碼行數:20,代碼來源:UserAPI.java

示例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;
    }
 
開發者ID:salRoid,項目名稱:Clasick,代碼行數:40,代碼來源:Timeline.java

示例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();
}
 
開發者ID:AvijitGhosh82,項目名稱:Madad_SOS,代碼行數:30,代碼來源:AcceptSOS.java

示例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);
        }
    });
}
 
開發者ID:fadelakin,項目名稱:bitdate,代碼行數:11,代碼來源:UserDataSource.java

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

    }
 
開發者ID:teamOSC,項目名稱:Studddinv2_android,代碼行數:37,代碼來源:PeopleSameInterestsFragment.java

示例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");
            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:31,代碼來源:ParseDatabase.java

示例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();
            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:15,代碼來源:ParseDatabase.java

示例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.
}
 
開發者ID:SCCapstone,項目名稱:diet,代碼行數:39,代碼來源:NewAccountFragment.java

示例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
            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:14,代碼來源:ParseDatabase.java

示例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);
}
 
開發者ID:MovieNetwork,項目名稱:Wubble,代碼行數:14,代碼來源:TopCommentsAdapter.java

示例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);
}
 
開發者ID:MovieNetwork,項目名稱:Wubble,代碼行數:14,代碼來源:FollowingCommentsAdapter.java


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