温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

cc_美团项目之我的账户页面实现

发布时间:2020-07-19 11:42:01 来源:网络 阅读:265 作者:愚人cc 栏目:移动开发


import cn.bmob.v3.BmobUser;


import com.chencheng.utils.LoginStatus;


import android.content.Intent;

import android.os.Bundle;

import android.support.v7.app.ActionBar;

import android.support.v7.app.ActionBarActivity;

import android.util.Log;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.TextView;


public class WodezhanghuActivity extends ActionBarActivity {

private TextView wodezhanghu_Username;

private TextView textView5;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_wodezhanghu);

initActionBar();

iniUi();

}


private void iniUi() {

if (LoginStatus.getInstance().hasLogin()){

com.chencheng.model.User myUser = BmobUser.getCurrentUser(this, com.chencheng.model.User.class);

TextView wodezhanghu_Username=(TextView)findViewById(R.id.wodezhanghu_Username);

wodezhanghu_Username.setText(myUser.getUsername());

TextView textView5=(TextView)findViewById(R.id.textView5);

btn_find_back_yanzheng=(Button)findViewById(R.id.btn_find_back_yanzheng);

btn_find_back_yanzheng.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

BmobUser.logOut(WodezhanghuActivity.this);

LoginStatus.getInstance().setHasLogin(false);

Intent intent=new Intent(WodezhanghuActivity.this,MainActivity.class);

intent.putExtra("flag", "hasLogin");

startActivity(intent);

}

});

Log.e("myUser.getMobilePhoneNumber()", myUser.getMobilePhoneNumber()+"");

if(!"".equals(myUser.getMobilePhoneNumber())&&myUser.getMobilePhoneNumber()!=null){

textView5.setText(myUser.getMobilePhoneNumber());

}else{

textView5.setText("无");

}

}else{

}

}


@Override

public boolean onSupportNavigateUp() {

finish();

return super.onSupportNavigateUp();

}


private void initActionBar() {

ActionBar actionBar = getSupportActionBar();

actionBar.setDisplayHomeAsUpEnabled(true);

actionBar.setBackgroundDrawable(getResources().getDrawable(

R.color.action_white));

actionBar.setTitle("我的账户");

}

}



cc_美团项目之我的账户页面实现

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI