本文整理匯總了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);
}
示例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();
}
示例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());
}
}
});
}
}
示例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);
}
}
示例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;
}
示例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()));
}
}
});
}
示例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();
}
示例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;
}
示例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();
}
});
}
示例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);
}
示例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();
}
示例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("評論失敗");
}
});}
示例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());
}
}
});
}
示例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);
}
示例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);
}
}