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


Java BmobUser.getCurrentUser方法代码示例

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


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

示例1: onHandleMedicallyEvent

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
@Subscribe(sticky = true)
public void onHandleMedicallyEvent(MedicallyEvent event) {
    Bpm bpm = new Bpm();
    bpm.setBpm(event.bpm);
    int value = Integer.valueOf(event.bpm);
    if (value >= 60 && value <= 90)
        bpm.setDescription("继续保持");
    else if (value < 60)
        bpm.setDescription("勤加锻炼");
    else if (value > 90)
        bpm.setDescription("注意休息");
    SimpleDateFormat mFormat = new SimpleDateFormat("MM-dd HH:mm", Locale.CHINA);
    bpm.setTime(mFormat.format(new Date()));
    data.add(bpm);
    L.i("onHandleMedicallyEvent: " + String.format("%sbpm ", event.bpm));
    mBpsTextView.setText(/*String.format("%s bpm ", */event.bpm);

    mBpmDao.insert(bpm);

    // send bpm to children
    User user = BmobUser.getCurrentUser(User.class);
    String username = user.getContact().get(0).getUsername();
    L.i("send " + username);
    checkConversations(username, bpm);

}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:27,代码来源:DataDisplayFragment.java

示例2: 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

示例3: connect

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
public static void connect(final User user, final BmobEvent.onConnectListener listener) {
    User curr = BmobUser.getCurrentUser(User.class);
    if (!TextUtils.isEmpty(curr.getObjectId())) {
        BmobIM.connect(user.getObjectId(), new ConnectListener() {
            @Override
            public void done(String s, BmobException e) {
                if (null == e) {
                    if (BmobIM.getInstance().getCurrentStatus().getCode() != ConnectionStatus.CONNECTED.getCode()) {
                        listener.connectFailed("haven't connect server");
                        return;
                    }
                    listener.connectSuccessful(user);
                } else {
                    listener.connectFailed(e.getMessage());
                }
            }
        });
    }
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:20,代码来源:BmobUtil.java

示例4: 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

示例5: 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

示例6: startFollowRequest

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void startFollowRequest(User user, final RequestListener<String> listener) {
    final User currentUser = BmobUser.getCurrentUser(User.class);
    BmobRelation relation = new BmobRelation();
    relation.add(user);
    currentUser.setFollowPerson(relation);
    currentUser.update(new UpdateListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
                listener.success(null);
            } else {
                listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
            }
        }
    });
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:17,代码来源:NetRequest.java

示例7: displayUser

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
@Override
public void displayUser(User user) {

    if (BmobUser.getCurrentUser(User.class) != null) {
        username.setText(user.getNickname());
        presenter.requestDisplayHeadPic(headImage, user.getHeadPic());
        presenter.requestDisplayUserInfoBg(imgUserInfoBg, user.getHeadPic());
    }
    mProgressDialog.dismiss();
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:11,代码来源:MainActivity.java

示例8: checkLoginStatus

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
/**
 * 检测是否登陆
 */
public boolean checkLoginStatus(RequestListener listener) {
    if (BmobUser.getCurrentUser(User.class) == null) {
        listener.error("您没有登陆哦!");
        return false;
    }
    return true;
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:11,代码来源:NetRequest.java

示例9: saveText

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void saveText(String content)
   {
       MyUser user = BmobUser.getCurrentUser(this, MyUser.class);
       Helps_a helps = new Helps_a();
       helps.setUser(user);
       helps.setContent(content);
       helps.setState(0);
helps.setPhontofile(false);
       helps.save(this, new SaveListener() {
	@Override
	public void onSuccess()
	{

	    mProgressDialog.dismiss();
	    finish();
	    SharedPreferences mySharedPreferences= getSharedPreferences("fba", AppCompatActivity.MODE_PRIVATE);
	    SharedPreferences.Editor editor = mySharedPreferences.edit();
	    editor.putString("stytoolpro", null);
	    editor.commit();
	}

	@Override
	public void onFailure(int i, String s)
	{
	    mProgressDialog.dismiss();
	}
    });
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:29,代码来源:l.java

示例10: initDatas

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void initDatas() {
    mDatas=new ArrayList<RobotChat>();
    RobotChat robotChat=new RobotChat();
    robotChat.setMsg("嗷呜(`・ω・´)ノ");
    robotChat.setDate(new Date(System.currentTimeMillis()));
    robotChat.setType(RobotChat.ChatType.INCOMING);
    mDatas.add(robotChat);

    user= BmobUser.getCurrentUser(this,MyUser.class);
    adapter=new RobotChatAdapter(this,mDatas,user);
    listView.setAdapter(adapter);
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:13,代码来源:RobotChatActivity.java

示例11: onCreate

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_update_password);
    ButterKnife.bind(this);

    mMyUser = BmobUser.getCurrentUser(MyUser.class);
    initToolbar();
    updatePasswordClickEvent();
}
 
开发者ID:struggledhard,项目名称:USay,代码行数:11,代码来源:UpdatePasswordActivity.java

示例12: publishComment

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void publishComment(String content)
{
	nico.styTool.MyUser user = BmobUser.getCurrentUser(getActivity(), nico.styTool.MyUser.class);
	if (user == null)
	{
		Intent intent = new Intent(getActivity(), nico.styTool.app_th.class);
		startActivity(intent);
		//toast("发表评论前请先登陆");
		return;
	}
	else if (TextUtils.isEmpty(content))
	{
		//toast("发表评论不能为空");
		return;
	}
	final Comment_ comment = new Comment_();
	comment.setContent(content);
	comment.setPost(weibo);
	comment.setSignature(android.os.Build.MODEL + System.getProperty("line.separator"));
	comment.setUser(user);
	comment.save(getActivity(), new SaveListener() {

			@Override
			public void onSuccess()
			{
				// TODO Auto-generated method stub
				findComments();
				et_content.setText("");
				//toast("评论成功");
			}

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

示例13: createRank

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void createRank() {
        Rank rank = new Rank();
        User user = BmobUser.getCurrentUser(User.class);
        rank.setTitle("测试");
        Uri uri = Uri.parse("content://media/external/images/media/246751");
//        File file = new File("content://media/external/images/media/246751");
//       // File file1 = new File("")
//        BmobFile bfile = new BmobFile(file);
//        rank.setImage(bfile);
        rank.setNo1(user);
        rank.setNo2(user);
        rank.setNo3(user);
        rank.setNo4(user);
        rank.setNo5(user);
        rank.setNo6(user);
        rank.setNo7(user);
        rank.setNo8(user);
        rank.setNo9(user);
        rank.setNo10(user);

        rank.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if (e == null) {
                    showToast("保存成功");
                } else {
                    showToast("保存失败" + e.getMessage() + e.getErrorCode());
                }
            }
        });
    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:32,代码来源:Main2Activity.java

示例14: initView

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void initView() {
    mEditUser = (TextView) findViewById(R.id.edit_user);
    mEditUser.setOnClickListener(this);
    mUserName = (EditText) findViewById(R.id.et_username);
    mSex = (EditText) findViewById(R.id.et_sex);
    mAge = (EditText) findViewById(R.id.et_ages);
    mDesc = (EditText) findViewById(R.id.et_desc);
    mConfirmUpdate = (Button) findViewById(R.id.confirm_update);
    mConfirmUpdate.setOnClickListener(this);
    mAddPic = (CircleImageView) findViewById(R.id.profile_image);
    mAddPic.setOnClickListener(this);

    UtilTools.getImageFromShare(this, mAddPic);

    mDialog = new CustomDialog(this,
            WindowManager.LayoutParams.MATCH_PARENT,
            WindowManager.LayoutParams.WRAP_CONTENT,
            R.layout.dialog_photo, R.style.pop_anim_style, Gravity.BOTTOM);
    //屏幕外点击无效
    mDialog.setCancelable(false);

    mCamera = (Button) mDialog.findViewById(R.id.btn_camera);
    mCamera.setOnClickListener(this);
    mPicture = (Button) mDialog.findViewById(R.id.btn_picture);
    mPicture.setOnClickListener(this);
    mCancel = (Button) mDialog.findViewById(R.id.btn_cancel);
    mCancel.setOnClickListener(this);

    //设置具体的值
    MyUser userInfo = BmobUser.getCurrentUser(MyUser.class);
    mUserName.setText(userInfo.getUsername());
    mAge.setText(userInfo.getAge() + "");
    mSex.setText(userInfo.isSex() ? "男" : "女");
    mDesc.setText(userInfo.getDesc());
    setEnabled(false);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:38,代码来源:UserActivity.java

示例15: deleteVideoHistory

import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void deleteVideoHistory(VideoDaoEntity daoEntity,int position) {
    if (BmobUser.getCurrentUser()==null){
        mPresenter.deleteFromDb(daoEntity,position);
    }else {
        mPresenter.deleteFromNet(daoEntity,position);
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:8,代码来源:HistoryActivity.java


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