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();
                }
            });
    
    
  • 相关阅读:
    cesium入门示例-矢量化单体分类
    cesium入门示例-3dTiles加载
    cesium入门示例-geoserver服务访问
    cesium入门示例-HelloWorld
    java中函数传值与引用问题
    jni使用问题总结
    geoserver源码学习与扩展——增加服务接口
    go-ipfs入门及介绍
    安装GoMap
    Gogeos安装
  • 原文地址:https://www.cnblogs.com/D10304/p/14909018.html
Copyright © 2011-2022 走看看