本文整理汇总了Java中com.parse.ParseQuery.whereEqualTo方法的典型用法代码示例。如果您正苦于以下问题:Java ParseQuery.whereEqualTo方法的具体用法?Java ParseQuery.whereEqualTo怎么用?Java ParseQuery.whereEqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.parse.ParseQuery
的用法示例。
在下文中一共展示了ParseQuery.whereEqualTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retreiveprofile
import com.parse.ParseQuery; //导入方法依赖的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
}
}
});
}
示例2: retreivetimelineprofile
import com.parse.ParseQuery; //导入方法依赖的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
}
}
});
}
示例3: loadParseData
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void loadParseData(String Id){
ParseQuery<ParseObject> query = ParseQuery.getQuery(EventTable);
query.whereEqualTo("PhotoAlbumId", Id);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> productParseList, com.parse.ParseException e) {
if (e == null) {
if(productParseList.size() > 0){
eventList.addAll(productParseList);
eventAdapter = new PhotosAdapter(mContext, eventList);
gridView.setAdapter(eventAdapter);
}else{
Toast.makeText(mContext,"Danh sách trống", Toast.LENGTH_SHORT).show();
}
} else {
e.printStackTrace();
LoggerFactory.e("loadParseData", "Error: " + e.getMessage());
}
}
});
}
示例4: verifyOrganization
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void verifyOrganization(){
final String enteredText = orgName.getText().toString().trim();
final RefreshingDialog rd = new RefreshingDialog(this);
rd.createRefreshingDialog();
ParseQuery<Organization> query = ParseQuery.getQuery(Organization.class);
query.whereEqualTo("name", enteredText);
query.findInBackground(new FindCallback<Organization>() {
@Override
public void done(List<Organization> objects, ParseException e) {
if(objects.isEmpty()){//new group
createGroupAlert(enteredText);
rd.stop();
}else{
joinGroupAlert(objects.get(0));
rd.stop();
}
}
});
}
示例5: doAsyncTask
import com.parse.ParseQuery; //导入方法依赖的package包/类
@Override
protected List<String> doAsyncTask(String... params) {
final List<String> lista = new ArrayList<String>();
state = params[0];
try {
ParseQuery<ParseObject> query = ParseQuery.getQuery("State");
query.whereEqualTo("name", state);
ParseObject parseObject = query.getFirst();
ParseQuery<ParseObject> queryCity = ParseQuery.getQuery("City");
queryCity.whereEqualTo("id_state", parseObject.getInt("id_state"));
List<ParseObject> parseObjects = queryCity.find();
for (ParseObject p : parseObjects){
lista.add(p.getString("name_city"));
}
return lista;
} catch (Exception e) {
return null;
}
}
示例6: onMessageSent
import com.parse.ParseQuery; //导入方法依赖的package包/类
@Override
public void onMessageSent(MessageClient client, Message message, String recipientId) {
final WritableMessage writableMessage = new WritableMessage(message.getRecipientIds().get(0), message.getTextBody());
//only add message to parse database if it doesn't already exist there
ParseQuery<ParseObject> query = ParseQuery.getQuery("ParseMessage");
query.whereEqualTo("sinchId", message.getMessageId());
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> messageList, com.parse.ParseException e) {
if (e == null) {
if (messageList.size() == 0) {
ParseObject parseMessage = new ParseObject("ParseMessage");
parseMessage.put("senderId", currentUserId);
parseMessage.put("recipientId", writableMessage.getRecipientIds().get(0));
parseMessage.put("messageText", writableMessage.getTextBody());
parseMessage.put("sinchId", writableMessage.getMessageId());
parseMessage.saveInBackground();
messageAdapter.addMessage(writableMessage, MessageAdapter.DIRECTION_OUTGOING);
}
}
}
});
}
示例7: getCurrentUserId
import com.parse.ParseQuery; //导入方法依赖的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());
}
}
});
}
示例8: updateName
import com.parse.ParseQuery; //导入方法依赖的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();
}
}
});
}
示例9: check
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void check() {
ParseQuery<ParseObject> query = ParseQuery.getQuery("Exsmple");
query.whereEqualTo("name", etNick.getText().toString());
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> scoreList, ParseException e) {
if (e == null) {
if (scoreList.size() > 0) {
handler.sendEmptyMessage(0);
} else {
Toast.makeText(Login.this, "Hellow illegal",
Toast.LENGTH_SHORT).show();
}
Log.d(AppConstants.MY_TAG, "Retrieved " + scoreList.size()
+ " " + scoreList.toString() + " scores");
} else {
Log.d(AppConstants.MY_TAG, "Error: " + e.getMessage());
}
}
});
}
示例10: updateEmail
import com.parse.ParseQuery; //导入方法依赖的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();
}
}
});
}
示例11: asyncGetUserInfo
import com.parse.ParseQuery; //导入方法依赖的package包/类
public void asyncGetUserInfo(final String username,final EMValueCallBack<EaseUser> callback){
ParseQuery<ParseObject> pQuery = ParseQuery.getQuery(CONFIG_TABLE_NAME);
pQuery.whereEqualTo(CONFIG_USERNAME, username);
pQuery.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject pUser, ParseException e) {
if(pUser!=null){
String nick = pUser.getString(CONFIG_NICK);
ParseFile pFile = pUser.getParseFile(CONFIG_AVATAR);
if(callback!=null){
EaseUser user = DemoHelper.getInstance().getContactList().get(username);
if(user!=null){
user.setNick(nick);
if (pFile != null && pFile.getUrl() != null) {
user.setAvatar(pFile.getUrl());
}
}else{
user = new EaseUser(username);
user.setNick(nick);
if (pFile != null && pFile.getUrl() != null) {
user.setAvatar(pFile.getUrl());
}
}
callback.onSuccess(user);
}
}else{
if(callback!=null){
callback.onError(e.getCode(), e.getMessage());
}
}
}
});
}
示例12: onCreateView
import com.parse.ParseQuery; //导入方法依赖的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;
}
示例13: checkID
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void checkID(final String idNumber)
{
//lookup logic here
ParseQuery<ParseObject> query = ParseQuery.getQuery(mGradeTableName);
query.whereEqualTo("id_number",idNumber);
query.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject parseObject, ParseException e) {
if(e == null)
{
mListener.onStudentFound(mCourse,parseObject,mLabCount);
}
else
{
if(e.getCode() == ParseException.OBJECT_NOT_FOUND)
{
Log.d("Student not found",idNumber+" not found in "+mGradeTableName+" table");
Toast.makeText(getActivity(),"Student "+idNumber+" Not found",Toast.LENGTH_LONG).show();
}
else
{
//Some other error
Log.d("Parse error","Code:"+e.getCode());
Toast.makeText(getActivity(),"Internal error",Toast.LENGTH_LONG).show();
}
}
}
});
}
示例14: pullData
import com.parse.ParseQuery; //导入方法依赖的package包/类
void pullData()
{
sos_list.clear();
ParseQuery<ParseObject> pq = ParseQuery.getQuery("SOS_Users");
pq.whereEqualTo("UserID", ParseUser.getCurrentUser());
pq.whereEqualTo("hasAccepted", true);
pq.include("SOSid");
pq.include("SOSid.UserID");
pq.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
if (e != null) {
e.printStackTrace();
return;
}
//Log.d("Chatlist", String.valueOf(list.size()));
//Log.d("Chatlist", list.get(0).keySet().toString());
for (ParseObject psos : list) {
ParseObject sos = psos.getParseObject("SOSid");
if(!sos.getBoolean("isActive"))
continue;
sos.pinInBackground();
sos_list.add(sos);
}
MyAdapter adapter = new MyAdapter(sos_list, getActivity());
listView.setAdapter(adapter);
swipeRefreshLayout.setRefreshing(false);
}
});
}
示例15: notifySOS
import com.parse.ParseQuery; //导入方法依赖的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();
}