本文整理汇总了Java中com.parse.ParseQuery.getQuery方法的典型用法代码示例。如果您正苦于以下问题:Java ParseQuery.getQuery方法的具体用法?Java ParseQuery.getQuery怎么用?Java ParseQuery.getQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.parse.ParseQuery
的用法示例。
在下文中一共展示了ParseQuery.getQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serverQuery
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void serverQuery() {
ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class);
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, @Nullable ParseException e) {
if (e == null){
kidArrayList.clear();
kidArrayList.addAll(list);
Kid.pinAllInBackground(kidArrayList);
applyAttendanceToKids();
adapter.notifyDataSetChanged();
listView.invalidate();
}else if(checkConnection()){
toaster("Error getting data from Server\nWorking offline!","l");
}
}
});
}
示例2: getContactInfos
import com.parse.ParseQuery; //导入方法依赖的package包/类
public void getContactInfos(List<String> usernames, final EMValueCallBack<List<EaseUser>> callback) {
ParseQuery<ParseObject> pQuery = ParseQuery.getQuery(CONFIG_TABLE_NAME);
pQuery.whereContainedIn(CONFIG_USERNAME, usernames);
pQuery.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> arg0, ParseException arg1) {
if (arg0 != null) {
List<EaseUser> mList = new ArrayList<EaseUser>();
for (ParseObject pObject : arg0) {
EaseUser user = new EaseUser(pObject.getString(CONFIG_USERNAME));
ParseFile parseFile = pObject.getParseFile(CONFIG_AVATAR);
if (parseFile != null) {
user.setAvatar(parseFile.getUrl());
}
user.setNick(pObject.getString(CONFIG_NICK));
EaseCommonUtils.setUserInitialLetter(user);
mList.add(user);
}
callback.onSuccess(mList);
} else {
callback.onError(arg1.getCode(), arg1.getMessage());
}
}
});
}
示例3: 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();
}
}
});
}
示例4: loadData
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void loadData() {
ParseQuery<UserInfo> query = ParseQuery.getQuery(UserInfo.class);
query.orderByDescending("score").setLimit(10);
query.findInBackground(new FindCallback<UserInfo>() {
@Override
public void done(List<UserInfo> objects, ParseException e) {
list.addAll(objects);
runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyDataSetChanged();
}
});
}
});
}
示例5: 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
}
}
});
}
示例6: addBullshITBank
import com.parse.ParseQuery; //导入方法依赖的package包/类
public void addBullshITBank(final String NewNumber){
if(NewNumber.length()<6){
Toast.makeText(mContext,
getResources().getString(R.string.too_short),
Toast.LENGTH_LONG).show();
}else{
ParseQuery<ParseObject> query = ParseQuery.getQuery("BullshITBankDB");
query.whereStartsWith("phone", NewNumber);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> parseObjects, ParseException e) {
if (parseObjects.size() > 0) {
Toast.makeText(mContext,
getResources().getString(R.string.duplicate),
Toast.LENGTH_LONG).show();
} else {
FragmentManager fragmentManager = getSupportFragmentManager();
DialogFragment ConfirmDialog = AddNewConfirmDialog.newInstance(NewNumber,GUID);
ConfirmDialog.show(fragmentManager,"confirmdialog");
}
}
});
}
}
示例7: getAttractionListFromParse
import com.parse.ParseQuery; //导入方法依赖的package包/类
public static List<Attraction> getAttractionListFromParse(){
final List<Attraction> attractionList = new ArrayList<Attraction>();
ParseQuery<ParseObject> query = ParseQuery.getQuery("Attraction");
// execute the query
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> attList, ParseException e) {
// Log.d("data", String.valueOf(followList.size()));
for(ParseObject object : attList)
{
attractionList.add(new Attraction(
object.getString("Name"),
object.getString("Description"),
object.getString("longDescription"),
Uri.parse(object.getString("imageUrl")),
Uri.parse(object.getString("secondaryImageUrl")),
new LatLng(object.getParseGeoPoint("location").getLatitude(),object.getParseGeoPoint("location").getLongitude()),
object.getString("city")
));
}
}
});
return attractionList;
}
示例8: refresh
import com.parse.ParseQuery; //导入方法依赖的package包/类
/**
* Refreshes the SnackList. That is, queries Parse for the current user's SnackEntrys and
* repopulates the SnackList with the result. If the query fails, the SnackList remains
* unchanged.
*
* @param callback Optional. The callback to invoke after completion.
*/
public void refresh(@Nullable final FindCallback<SnackEntry> callback){
Log.d(TAG, "Refresh start");
notifyUpdateStart();
ParseQuery<SnackEntry> query = ParseQuery.getQuery(SnackEntry.class);
query.orderByDescending("createdAt");
query.whereEqualTo("owner", targetUser);
query.setLimit(10);
query.findInBackground(new FindCallback<SnackEntry>() {
@Override
public void done(List<SnackEntry> refreshedSnacks, ParseException e) {
if (e == null) {
snacks.clear();
snacks.addAll(refreshedSnacks);
}
if (callback != null) {
callback.done(refreshedSnacks, e);
}
notifyUpdateComplete(e);
}
});
}
示例9: visitHistoryDialog
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void visitHistoryDialog(){
AlertDialog.Builder visitHistoryBuilder = new AlertDialog.Builder(KidDetail.this);
visitHistoryBuilder.setCancelable(true);
LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
View view = inflater.inflate(R.layout.visit_history,null);
visitHistoryBuilder.setView(view);
final TextView historyText = (TextView) view.findViewById(R.id.historyText);
final StringBuilder historyString = new StringBuilder();
ParseQuery<Visit> query = ParseQuery.getQuery(Visit.class);//.fromLocalDatastore();
query.whereContains("kidId",myKid.getObjectId());
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Visit>() {
@Override
public void done(@NonNull List<Visit> list, @Nullable ParseException e) {
if (e == null){
if(list.size()!=0){
for (int i = 0; i < list.size() ; i++) {
Visit visit = list.get(i);
historyString.append("Visit No. : "+ (i+1)+"\n");
historyString.append("Visit Date: "+visit.getVisitDate()+"\n");
historyString.append("Servants:\n "+visit.getServants()+"\n");
historyString.append("Visit summary:\n "+visit.getSummary()+"\n\n\n");
}
historyText.setText(historyString);
}else{
historyText.setText("No visit history found!\nPlease pay a visit asap.");
}
}else{Toast.makeText(getApplicationContext(),"Error!",Toast.LENGTH_LONG).show();}
}
});
AlertDialog historyDialog = visitHistoryBuilder.create();
historyDialog.show();
}
示例10: getModelIdFromServer
import com.parse.ParseQuery; //导入方法依赖的package包/类
private void getModelIdFromServer(final String filePath) {
showProgressDialog();
ParseQuery<ParseObject> parseQuery = ParseQuery.getQuery("Model");
parseQuery.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
if (objects != null && objects.size() > 0) {
String model = objects.get(0).getString("model_id");
try {
readFile(filePath, model);
} catch (IOException ioe) {
ioe.printStackTrace();
}
} else {
Toast.makeText(MainActivity.this, "Can't get model", Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(MainActivity.this, "Can't get model", Toast.LENGTH_LONG).show();
}
}
});
}
示例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: load
import com.parse.ParseQuery; //导入方法依赖的package包/类
public void load(){
ParseQuery<CustomUser> query = ParseQuery.getQuery(CustomUser.class);
query.fromPin(USER);
try {
if(query.count() == 0){
return;
}
user = query.getFirst();
} catch (ParseException e) {
}
}
示例13: checkForNotes
import com.parse.ParseQuery; //导入方法依赖的package包/类
public List<Note> checkForNotes(){
ParseQuery<Note> query = ParseQuery.getQuery(Note.class);
query.whereEqualTo("toUser", UserAccount.getInstance().getUser());
query.whereEqualTo("read", false);
query.whereEqualTo("isCached", false);
try {
newNotes = query.find();
} catch (ParseException e) {
e.printStackTrace();
}
return newNotes;
}
示例14: LoadData
import com.parse.ParseQuery; //导入方法依赖的package包/类
public void LoadData() {
ParseQuery<ParseObject> query = ParseQuery.getQuery("Product");
query.setLimit(5).orderByAscending("createdAt");
query.whereContains("title", this.query);
dialog = new ProgressDialog(this);
dialog.setTitle("Loading");
dialog.setMessage("Please Wait...");
dialog.show();
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
dialog.dismiss();
if (e == null) {
data.clear();
for (int a = 0; a < list.size(); a++) {
ParseObject object = list.get(a);
ItemsModel model = new ItemsModel();
model.setDate(String.valueOf(object.getCreatedAt().toLocaleString()));
model.setPrice(object.getNumber("price").toString());
model.setPhone(object.getNumber("phone").toString());
model.setDesc(object.getString("desc"));
model.setTitle(object.getString("title"));
model.setImagefile(object.getParseFile("image").getUrl());
data.add(model);
}
adapter = new RecyclerViewAdapter(data, SearchableActivity.this);
adapter.setClickListener(SearchableActivity.this);
recyclerView.setAdapter(adapter);
}else {
Toast.makeText(SearchableActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
示例15: 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);
}
});
}