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


Java ParseQuery類代碼示例

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


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

示例1: localQuery

import com.parse.ParseQuery; //導入依賴的package包/類
private void localQuery(){
    ParseQuery<Kid> lQuery = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
    lQuery.orderByAscending("createdAt");
    lQuery.findInBackground(new FindCallback<Kid>() {
        @Override
        public void done(List<Kid> list, ParseException e) {
            if (e == null) {

                kidArrayList.clear();
                kidArrayList.addAll(list);
                fillHashMap();
                adapter = new AddAttendanceAdapter(AddAttendance.this,kidArrayList,activityMap);
                listView.setAdapter(adapter);
                listView.invalidate();
            }

        }
    });
}
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:20,代碼來源:AddAttendance.java

示例2: localQuery

import com.parse.ParseQuery; //導入依賴的package包/類
private void localQuery(){
    ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
    query.orderByAscending("createdAt");
    query.findInBackground(new FindCallback<Kid>() {
        @Override
        public void done(List<Kid> list, @Nullable ParseException e) {
            if (e == null && list.size()!=0) {
                kidArrayList.clear();
                kidArrayList.addAll(list);
                applyAttendanceToKids();
                adapter.notifyDataSetChanged();
                listView.invalidate();
                   }
                    }
                });
}
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:17,代碼來源:MainActivity.java

示例3: 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");
        }
    }
});
        }
 
開發者ID:amir511,項目名稱:My-Sheep,代碼行數:20,代碼來源:MainActivity.java

示例4: getAnimeListByUrl

import com.parse.ParseQuery; //導入依賴的package包/類
@Override
public List<Anime> getAnimeListByUrl(String url) {
    ArrayList<Anime> animeList = new ArrayList<>();
    ParseQuery<AnimeRecord> query = AnimeRecord.getQuery();
    try {
        List<AnimeRecord> animeRecords = query.whereContains("url", url).find();
        for (AnimeRecord record : animeRecords) {
            Anime anime = AnimeRecord.toAnime(record);
            if (anime != null)
                animeList.add(anime);
        }
    } catch (ParseException e) {
        WriteLog.appendLogException(TAG, "getAnimeListByUrl(" + url + ") failed", e);
    }
    return animeList;
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:17,代碼來源:ParseManager.java

示例5: getAnimeListByTitle

import com.parse.ParseQuery; //導入依賴的package包/類
@Override
public List<Anime> getAnimeListByTitle(String title) {
    ArrayList<Anime> animeList = new ArrayList<>();
    ParseQuery<AnimeRecord> query = AnimeRecord.getQuery();
    try {
        List<AnimeRecord> animeRecords = query.whereContains("title", title).find();
        for (AnimeRecord record : animeRecords) {
            Anime anime = AnimeRecord.toAnime(record);
            if (anime != null)
                animeList.add(anime);
        }
    } catch (ParseException e) {
        WriteLog.appendLogException(TAG, "getAnimeListByTitle(" + title + ") failed", e);
    }
    return animeList;
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:17,代碼來源:ParseManager.java

示例6: 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());
			}
		}
	});
}
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:27,代碼來源:ParseManager.java

示例7: getEventData

import com.parse.ParseQuery; //導入依賴的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

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

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

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

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

示例10: categorySpinnerSetup

import com.parse.ParseQuery; //導入依賴的package包/類
public void categorySpinnerSetup() {
    ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
        public ParseQuery create() {
            ParseQuery query = new ParseQuery("Category");
            return query;
        }
    };

    categoryAdapter = new ParseQueryAdapter<ParseObject>(this,
            factory);
    categoryAdapter.setTextKey("name");
    categorySpinner.setAdapter(categoryAdapter);
    categorySpinner.setSelection(1);
    categorySpinner
            .setOnItemSelectedListener(new CategorySpinnerListener());
}
 
開發者ID:BehrouzRiahu,項目名稱:Marketplace,代碼行數:17,代碼來源:PostActivity.java

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

}
 
開發者ID:SEA2015-GROUP7,項目名稱:projectTetViet,代碼行數:23,代碼來源:PhotoActivity.java

示例12: loadParseData

import com.parse.ParseQuery; //導入依賴的package包/類
private void loadParseData(){
    ParseQuery<ParseObject> query = ParseQuery.getQuery(tableName);
    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 VideoAdapter(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());
            }
        }
    });

}
 
開發者ID:SEA2015-GROUP7,項目名稱:projectTetViet,代碼行數:22,代碼來源:VideosActivity.java

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

}
 
開發者ID:donniepropst,項目名稱:note.cntxt,代碼行數:22,代碼來源:CreateOrganization.java

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

}
 
開發者ID:whu-iss-jack,項目名稱:langren,代碼行數:18,代碼來源:GameTopActivity.java

示例15: updateMessage

import com.parse.ParseQuery; //導入依賴的package包/類
/**
 * Request a single message in a conversation to be updated.
 */
private void updateMessage(@NonNull String conversationId, @NonNull String messageId) {
    ParseQuery<ParseObject> query = new ParseQuery<>(MessagesTable.NAME);
    query.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ONLY);
    query.include(MessagesTable.Fields.IMAGE);
    Log.d(TAG, "Updating message: " + messageId);

    mParseHelper.get(query, messageId)
        .map(in -> ParseUtils.from(in, mParseHelper))
        .toList()
        .subscribe(messages -> {
            for (ExampleMessage message : messages) {
                mUpdatePublisher.onNext(new Update<>(conversationId, Update.Action.UPDATED, null, message));
            }
        });
}
 
開發者ID:badoo,項目名稱:Chateau,代碼行數:19,代碼來源:ParseMessageDataSource.java


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