zoukankan      html  css  js  c++  java
  • 每日汇报

    今天尝试写登陆代码

            BmobQuery<Bean> b = new BmobQuery<>();
            b.addWhereEqualTo("Phone",phone.getText().toString());
            b.findObjects(new FindListener<Bean>() {
                @Override
                public void done(List<Bean> list, BmobException e) {
                    if (e == null) {
                        if(list.size()>0){
                            if (password.getText().toString().equals(list.get(0).Password)){
                                if (agreement.isChecked()&&list.get(0).State.equals("T")) {
    
                                    EMClient.getInstance().login(list.get(0).Phone,list.get(0).Password,new EMCallBack() {//回调
                                        @Override
                                        public void onSuccess() {
                                            EMClient.getInstance().groupManager().loadAllGroups();
                                            EMClient.getInstance().chatManager().loadAllConversations();
                                            Log.d("main", "登录成功!");
                                        }
    
                                        @Override
                                        public void onProgress(int progress, String status) {
    
                                        }
    
                                        @Override
                                        public void onError(int code, String message) {
                                            Log.d("main", "登录失败!");
                                        }
                                    });
    
                                    Intent intent = new Intent(Login.this, Friend.class);
                                    intent.putExtra("id", list.get(0).getObjectId());
                                    intent.putExtra("phone", phone.getText().toString());
                                    Toast.makeText(Login.this,"登录成功!",Toast.LENGTH_SHORT).show();
                                    startActivity(intent);
                                    finish();
                                }
                            }
                        }
                    }else
                        Toast.makeText(Login.this,e.getMessage(), Toast.LENGTH_SHORT).show();
                }
            });
    
    
  • 相关阅读:
    [SDOI2015]约数个数和
    [POI2007]ZAP-Queries
    fpu栈溢出
    shader 汇编
    sample a texture as a rendertarget
    ID3d11asynchronous
    DEVICE DRAW VERTEX BUFFER TOO SMALL
    模型的一个点显示在原点
    setrendertraget 上下颠倒
    skinned mesh 蜘蛛样
  • 原文地址:https://www.cnblogs.com/D10304/p/14909018.html
Copyright © 2011-2022 走看看