当前位置: 首页>>代码示例>>Java>>正文


Java ParseQuery.addAscendingOrder方法代码示例

本文整理汇总了Java中com.parse.ParseQuery.addAscendingOrder方法的典型用法代码示例。如果您正苦于以下问题:Java ParseQuery.addAscendingOrder方法的具体用法?Java ParseQuery.addAscendingOrder怎么用?Java ParseQuery.addAscendingOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.parse.ParseQuery的用法示例。


在下文中一共展示了ParseQuery.addAscendingOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResume

import com.parse.ParseQuery; //导入方法依赖的package包/类
@Override
public void onResume() {
	super.onResume();
	
	mCurrentUser = ParseUser.getCurrentUser();
	mFriendsRelation = mCurrentUser.getRelation(ParseConstants.KEY_FRIENDS_RELATION);
	
	getActivity().setProgressBarIndeterminateVisibility(true);
	
	ParseQuery<ParseUser> query = mFriendsRelation.getQuery();
	query.addAscendingOrder(ParseConstants.KEY_USERNAME);
	query.findInBackground(new FindCallback<ParseUser>() {
		@Override
		public void done(List<ParseUser> friends, ParseException e) {
			getActivity().setProgressBarIndeterminateVisibility(false);
			
			if (e == null) {
				mFriends = friends;
				
				String[] usernames = new String[mFriends.size()];
				int i = 0;
				for(ParseUser user : mFriends) {
					usernames[i] = user.getUsername();
					i++;
				}
				if (mGridView.getAdapter() == null) {
					UserAdapter adapter = new UserAdapter(getActivity(), mFriends);
					mGridView.setAdapter(adapter);
				}
				else {
					((UserAdapter)mGridView.getAdapter()).refill(mFriends);
				}
			}
			else {
				Log.e(TAG, e.getMessage());
				AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
				builder.setMessage(e.getMessage())
					.setTitle(R.string.error_title)
					.setPositiveButton(android.R.string.ok, null);
				AlertDialog dialog = builder.create();
				dialog.show();
			}
		}
	});
}
 
开发者ID:NagabhushanS,项目名称:AmazingFriends,代码行数:46,代码来源:FriendsFragment.java

示例2: onResume

import com.parse.ParseQuery; //导入方法依赖的package包/类
@Override
public void onResume() {
	super.onResume();
	
	mCurrentUser = ParseUser.getCurrentUser();
	mFriendsRelation = mCurrentUser.getRelation(ParseConstants.KEY_FRIENDS_RELATION);
	
	setProgressBarIndeterminateVisibility(true);
	
	ParseQuery<ParseUser> query = mFriendsRelation.getQuery();
	query.addAscendingOrder(ParseConstants.KEY_USERNAME);
	query.findInBackground(new FindCallback<ParseUser>() {
		@Override
		public void done(List<ParseUser> friends, ParseException e) {
			setProgressBarIndeterminateVisibility(false);
			
			if (e == null) {
				mFriends = friends;
				
				String[] usernames = new String[mFriends.size()];
				int i = 0;
				for(ParseUser user : mFriends) {
					usernames[i] = user.getUsername();
					i++;
				}

				if (mGridView.getAdapter() == null) {
					UserAdapter adapter = new UserAdapter(RecipientsActivity.this, mFriends);
					mGridView.setAdapter(adapter);
				}
				else {
					((UserAdapter)mGridView.getAdapter()).refill(mFriends);
				}
			}
			else {
				Log.e(TAG, e.getMessage());
				AlertDialog.Builder builder = new AlertDialog.Builder(RecipientsActivity.this);
				builder.setMessage(e.getMessage())
					.setTitle(R.string.error_title)
					.setPositiveButton(android.R.string.ok, null);
				AlertDialog dialog = builder.create();
				dialog.show();
			}
		}
	});
}
 
开发者ID:NagabhushanS,项目名称:AmazingFriends,代码行数:47,代码来源:RecipientsActivity.java


注:本文中的com.parse.ParseQuery.addAscendingOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。