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


Java BmobUser类代码示例

本文整理汇总了Java中cn.bmob.v3.BmobUser的典型用法代码示例。如果您正苦于以下问题:Java BmobUser类的具体用法?Java BmobUser怎么用?Java BmobUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: registerData

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
/**
 * 注册
 */
private void registerData() {

    final String name = etusername.getText().toString();
    final String password = etpassword.getText().toString();
    final String email = etemail.getText().toString();
    BmobUser bu = new BmobUser();
    bu.setUsername(name);
    bu.setPassword(password);
    bu.setEmail(email);
    bu.signUp(new SaveListener<BmobUser>() {
        @Override
        public void done(BmobUser bmobUser, BmobException e) {
            if(e==null){
                Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
                RegisterActivity.this.finish();
            }else{
                Toast.makeText(RegisterActivity.this, "注册失败", Toast.LENGTH_SHORT).show();
            }}
    });
}
 
开发者ID:chenlindev,项目名称:beyondwords,代码行数:24,代码来源:RegisterActivity.java

示例2: findWeibos_

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void findWeibos_()
{
	nico.styTool.MyUser user = BmobUser.getCurrentUser(this, nico.styTool.MyUser.class);
	BmobQuery<Post_> query = new BmobQuery<Post_>();
	query.addWhereEqualTo("author", user);	// 查询当前用户的所有微博
	query.order("-updatedAt");
	query.include("author");// 希望在查询微博信息的同时也把发布人的信息查询出来,可以使用include方法
	query.findObjects(this, new FindListener<Post_>() {
			@Override
			public void onSuccess(List<Post_> object)
			{
				// TODO Auto-generated method stub
				weibos = object;
				adapter.notifyDataSetChanged();
				//et_content.setText("");
			}

			@Override
			public void onError(int code, String msg)
			{
				// TODO Auto-generated method stub
				//toast("查询失败:"+msg);
			}
		});
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:26,代码来源:WeiboListActivity.java

示例3: onCreate

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState != null){
        Log.e("fragment","恢复fragment"+KEY_FRAGMENT_TAG);
        restoreFragments();//恢复fragment
        mFragmentCurrentTag = savedInstanceState.getString(KEY_FRAGMENT_TAG);
    }
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    Bmob.initialize(getApplication(), "8641a3984f7c4a4e3d19558a69423ecf");
    user = BmobUser.getCurrentUser(this, User.class);
    mDrawer = (FlowingDrawer) findViewById(R.id.drawerlayout);
    mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL);
    mLayouts = new LinearLayout[]{
            layoutHome, layoutCategorize, layoutMore
    };
    setupToolbar();
    setupFeed();
    setupMenu();
    setListener();
    update();
}
 
开发者ID:Break369,项目名称:MyLife,代码行数:24,代码来源:MainActivity.java

示例4: updateUserLocation

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void updateUserLocation(String city) {
    User mCurrentUser = BmobUser.getCurrentUser(User.class);
    if (mCurrentUser != null) {
        // 允许用户使用应用
        User user = new User();
        user.setLocation(city);
        user.update(mCurrentUser.getObjectId(), new UpdateListener() {
            @Override
            public void done(BmobException e) {
                if (e == null) {

                } else {
                    ToastUtils.showToast(WeatherActivity.this, "Error:" + e.getMessage());
                }
            }
        });
    } else {
        //缓存用户对象为空时, 可打开用户注册界面…
        ToastUtils.showToast(WeatherActivity.this, "no cache");
    }

}
 
开发者ID:monsterLin,项目名称:Pigeon,代码行数:23,代码来源:WeatherActivity.java

示例5: refreshData

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
/**
  * 刷新数据操作
  */
 private void refreshData(List<KeepInfo> mDatas){

     MyUser bmobUser=BmobUser.getCurrentUser(MyUser.class);

     if (bmobUser!=null){
         MyUser newUser=new MyUser();
newUser.setValue("keep",mDatas);

         newUser.update(bmobUser.getObjectId(), new UpdateListener() {
             @Override
             public void done(BmobException e) {

                 if (e==null){

                     Toast.makeText(UIUtils.getContext(),"删除成功",Toast.LENGTH_SHORT).show();
                 }else {
                     Toast.makeText(UIUtils.getContext(),"删除失败 请重试",Toast.LENGTH_SHORT).show();
                 }
             }
         });
     }
 }
 
开发者ID:android-jian,项目名称:topnews,代码行数:26,代码来源:KeepOneFragment.java

示例6: onCreateView

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.she_qu_fragment, container, false);
    ButterKnife.bind(this, view);

    mMyUser = BmobUser.getCurrentUser(MyUser.class);
    mSheQuAdapter = new SheQuAdapter(getActivity());
    initToolbar();
    initRecycler();
    initRefresh();
    scrollMoreData();
    // 想让Fragment中的onCreateOptionsMenu生效必须先调用setHasOptionsMenu方法
    // 否则Toolbar没有菜单
    setHasOptionsMenu(true);
    return view;
}
 
开发者ID:struggledhard,项目名称:USay,代码行数:18,代码来源:SheQuFragment.java

示例7: initData

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
@Override
public void initData() {
    mCurrentUser = BmobUser.getCurrentUser(User.class);
    BmobFile userPhotoFile = mCurrentUser.getUserPhoto();
    String nick = mCurrentUser.getNick();
    String objectId = mCurrentUser.getObjectId();


    if (!TextUtils.isEmpty(nick)) {
        mTvName.setText(nick);
    }

    if (!TextUtils.isEmpty(objectId)) {
        mTvID.setText("飞鸽号:" + objectId);
    }

    if (userPhotoFile == null) {
        mCivUserPhoto.setImageResource(R.drawable.ic_default);
    } else {
        Picasso.with(getContext()).load(userPhotoFile.getFileUrl()).into(mCivUserPhoto);
    }

}
 
开发者ID:monsterLin,项目名称:Pigeon,代码行数:24,代码来源:PersonFragment.java

示例8: sendToChildrenLocation

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void sendToChildrenLocation(final String address, final LatLng latLng) {
    LocationMessage message = new LocationMessage();
    message.setContent("location");
    Map<String, Object> map = new HashMap<>();
    map.put("id", BmobUser.getCurrentUser(User.class).getUsername());
    map.put("address", address);
    map.put("latitude", latLng.latitude);
    map.put("longitude", latLng.longitude);
    message.setExtraMap(map);

    L.i("send location");

    mConversationManager.sendMessage(message, new MessageSendListener() {
        @Override
        public void done(BmobIMMessage bmobIMMessage, BmobException e) {
            if (e != null) {
                L.i("send location failed " + e.getMessage());
            } else {
                L.i("send location successfully");
                L.i("address: " + address);
                L.i("latitude: " + latLng.latitude);
                L.i("longitude: " + latLng.longitude);
            }
        }
    });
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:27,代码来源:HandleMessageService.java

示例9: refreshView

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void refreshView() {
    Cache cache = ArmsUtils.obtainAppComponentFromContext(FollowButton.this.getContext()).extras();
    List<MyAttentionEntity> entities = CommonUtils.getFollowedInfo(mContext);
    if (entities != null && BmobUser.getCurrentUser() != null) {
        boolean isFollowed = false;
        for (MyAttentionEntity entity : entities) {
            if (entity.getId() == this.attention.getId()) {
                isFollowed = true;
            }
        }
        if (isFollowed) {
            setState(FOLLOWED);
        } else {
            setState(UNFOLLOWED);
        }
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:18,代码来源:FollowButton.java

示例10: initData

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
@Override
    public void initData() {
        bmobUser = BmobUser.getCurrentUser();
//        if (bmobUser != null) {
//
//            isExist = SPUtils.getBoolean(FamilyConfig.SPEXIST, false);
//
//            if (isExist) {
//                AppManager.getAppManager().finishActivity();
//                nextActivity(MainActivity.class);
//            } else {
//                AppManager.getAppManager().finishActivity();
//                nextActivity(GuideFamilyActivity.class);
//            }
//
//        }
    }
 
开发者ID:monsterLin,项目名称:Pigeon,代码行数:18,代码来源:LoginActivity.java

示例11: queryFanNum

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
/**
 * 查询粉丝数目
 */

private void queryFanNum() {
    BmobQuery<User> query = new BmobQuery<>();
    query.include("focus");
    BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
    innerQuery.addWhereEqualTo("objectId", dynamicAuthor.getObjectId());
    query.addWhereMatchesQuery("focus", "_User", innerQuery);
    query.count(User.class, new CountListener() {
        @Override
        public void done(Integer integer, BmobException e) {
            if (e == null) {
                tvFan.setText(integer.toString());
            } else {
                showToast("查询粉丝数目失败" + e.getErrorCode() + e.getMessage());
            }
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:22,代码来源:PersonPageActivity.java

示例12: isShowLike

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private boolean isShowLike() {

        if (article.getLikeIdList() != null && MyApp.isLogin()) {
            HashSet<String> set = new HashSet<>();
            for (String id : article.getLikeIdList()) {
                set.add(id);
            }
            if (set.contains(BmobUser.getCurrentUser(User.class).getObjectId())) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }

    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:18,代码来源:ArticleDetailActivity.java

示例13: isShowCollect

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private boolean isShowCollect() {
    if (article.getCollectIdList() != null && MyApp.isLogin()) {
        HashSet<String> set = new HashSet<>();
        for (String id : article.getCollectIdList()) {
            set.add(id);
        }
        if (set.contains(BmobUser.getCurrentUser(User.class).getObjectId())) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }

}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:17,代码来源:ArticleDetailActivity.java

示例14: toCollect

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void toCollect() {
        BmobRelation relation = new BmobRelation();
//        将当前用户添加到MActivity表中的collect字段中,表名当前用户收藏了该活动内容
        relation.add(BmobUser.getCurrentUser(User.class));
        article.setCollect(relation);

        if (article.getCollectIdList() != null) {
            collectIdList = article.getCollectIdList();
        }
        collectIdList.add(user.getObjectId());
        article.setCollectIdList(collectIdList);
        article.update(new UpdateListener() {
            @Override
            public void done(BmobException e) {
                if (e == null) {
                    Log.e(TAG, "收藏成功");

                    ivCollect.setImageResource(R.drawable.ic_favorite_orange_500_24dp);
                    isCollect = true;
                } else {
                    Log.e(TAG, "收藏失败" + e.getMessage() + e.getErrorCode());
                }
            }
        });

    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:27,代码来源:ArticleDetailActivity.java

示例15: cancelCollect

import cn.bmob.v3.BmobUser; //导入依赖的package包/类
private void cancelCollect() {
    BmobRelation relation = new BmobRelation();
    relation.remove(BmobUser.getCurrentUser(User.class));
    article.setCollect(relation);
    //                    移除当前用户的收藏ID
    if (article.getCollectIdList() != null) {
        collectIdList = article.getCollectIdList();
    }
    collectIdList.remove(user.getObjectId());
    article.setCollectIdList(collectIdList);
    article.update(new UpdateListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
                Log.e(TAG, "取消收藏成功");


                ivCollect.setImageResource(R.drawable.ic_favorite_border_grey_500_24dp);
                isCollect = false;

            } else {
                Log.e(TAG, "取消收藏失败" + e.getErrorCode() + e.getMessage());
            }
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:27,代码来源:ArticleDetailActivity.java


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