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


Java EMError.USER_REMOVED属性代码示例

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


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

示例1: onDisconnected

@Override
public void onDisconnected(int error) {
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE || error == EMError.SERVER_SERVICE_RESTRICTED) {
        isConflict = true;
    } else {
       handler.sendEmptyMessage(0);
    }
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:8,代码来源:EaseConversationListFragment.java

示例2: onDisconnected

@Override
public void onDisconnected(int error) {
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE || error == EMError.SERVER_SERVICE_RESTRICTED) {
        isConflict = true;
    } else {
        getActivity().runOnUiThread(new Runnable() {
            public void run() {
                onConnectionDisconnected();
            }

        });
    }
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:13,代码来源:EaseContactListFragment.java

示例3: onDisconnected

@Override
public void onDisconnected(int error) {
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE || error == EMError.SERVER_SERVICE_RESTRICTED
            || error == EMError.USER_KICKED_BY_CHANGE_PASSWORD || error == EMError.USER_KICKED_BY_OTHER_DEVICE) {
        isConflict = true;
    } else {
       handler.sendEmptyMessage(0);
    }
}
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:9,代码来源:EaseConversationListFragment.java

示例4: onDisconnected

@Override
public void onDisconnected(int error) {
    //USER_REMOVED:账号已经被移除 USER_LOGIN_ANOTHER_DEVICE:账号在别的地方登录
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE || error == EMError.SERVER_SERVICE_RESTRICTED
            || error == EMError.USER_KICKED_BY_CHANGE_PASSWORD || error == EMError.USER_KICKED_BY_OTHER_DEVICE) {
        isConflict = true;
    } else {
        Log.d("----", "onDisconnected: 环信出现问题,断线了");
        handler.sendEmptyMessage(0);
    }
}
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:11,代码来源:MessageFragment.java

示例5: onDisconnected

@Override
public void onDisconnected(int error) {
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
        isConflict = true;
    } else {
       handler.sendEmptyMessage(0);
    }
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:8,代码来源:EaseConversationListFragment.java

示例6: onDisconnected

@Override
public void onDisconnected(int error) {
    if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
        isConflict = true;
    } else {
        getActivity().runOnUiThread(new Runnable() {
            public void run() {
                onConnectionDisconnected();
            }

        });
    }
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:13,代码来源:EaseContactListFragment.java

示例7: setGlobalListeners

/**
 * 设置全局事件监听
 */
protected void setGlobalListeners(){
    
    // create the global connection listener
    connectionListener = new EMConnectionListener() {
        @Override
        public void onDisconnected(int error) {
            if (error == EMError.USER_REMOVED) {
                onCurrentAccountRemoved();
            }else if (error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
                onConnectionConflict();
            }
        }

        @Override
        public void onConnected() {
            
            // in case group and contact were already synced, we supposed to notify sdk we are ready to receive the events
            if(true){
                new Thread(){
                    @Override
                    public void run(){
                        HuanXinHelper.getInstance().notifyForRecevingEvents();
                    }
                }.start();
            }else{
            }
        }
    };
    
    //注册连接监听
    EMClient.getInstance().addConnectionListener(connectionListener);
    //注册消息事件监听
    registerEventListener();
    
}
 
开发者ID:tianyuan168326,项目名称:nono-android,代码行数:38,代码来源:HuanXinHelper.java

示例8: onDisconnected

@Override
        public void onDisconnected(int error) {
            if (error == EMError.USER_REMOVED || error == EMError.SERVER_SERVICE_RESTRICTED) {
//                GApplication.getInstance().showLogout(getActivity());
//                isConflict = true;
                return;
            } else if (error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
//                GApplication.getInstance().showLogout(getActivity());
                try {
//                    BroadcastReceiverUtils.sendBroadcastReceiver(mContext,BroadcastReceiverUtils.LOGIN_OUT);
//                    GApplication.getInstance().showLogout(mContext);
//                    if ( getActivity() instanceof MainActivity){
//                        ((MainActivity)getActivity()).LoingOut();
//                    }else if (getActivity() instanceof SearchActivity){
//                        ((SearchActivity)getActivity()).LoingOut();
//                    }else {
//                        ACache.get(getActivity()).clear();
//                        ACache.get(getActivity()).put(ACacheKey.FIRST_USE, "111");
//                        ToastUtil.showToast("登录信息已失效,请重新登录",getActivity());
//                        Handler handler = new Handler();
//                        handler.postDelayed(new Runnable() {
//                            @Override
//                            public void run() {
//
//                                ActivityManagerUtil.getInstance().finishAllActivity();
//                                Intent intent = new Intent(getActivity(), LoginActivity.class);
//                                getActivity().startActivity(intent);
//                            }
//                        },1000);
//                    }
                    LoginOut();





                } catch (Exception e1) {

                }

            } else {
                handler.sendEmptyMessage(0);
            }
        }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:44,代码来源:EaseConversationListFragment.java

示例9: onDisconnected

@Override
        public void onDisconnected(int error) {
            if (error == EMError.USER_REMOVED || error == EMError.SERVER_SERVICE_RESTRICTED) {
                isConflict = true;
            } else if (error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
//                GApplication.getInstance().showLogout(getActivity());
                try {
//                    BroadcastReceiverUtils.sendBroadcastReceiver(mContext,BroadcastReceiverUtils.LOGIN_OUT);

//                    GApplication.getInstance().showLogout(mContext);
//                    ACache.get(getActivity()).clear();
//                    ACache.get(getActivity()).put(ACacheKey.FIRST_USE, "111");
//                    ToastUtil.showToast("登录信息已失效,请重新登录",getActivity());
//
//
//                    Handler handler = new Handler();
//                    handler.postDelayed(new Runnable() {
//                        @Override
//                        public void run() {
//
//                            ActivityManagerUtil.getInstance().finishAllActivity();
//                            Intent intent = new Intent(getActivity(), LoginActivity.class);
//                            getActivity().startActivity(intent);
//                        }
//                    },1000);

                    if (getActivity() instanceof  EaseBaseActivity){
                        ((EaseBaseActivity)getActivity()).LoingOut();
                    }else if (getActivity() instanceof MainActivity){
                        ((MainActivity)getActivity()).LoingOut();
                    }



                } catch (Exception e1) {

                }
            } else {
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        onConnectionDisconnected();
                    }

                });
            }
        }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:46,代码来源:EaseContactListFragment.java

示例10: setGlobalListeners

/**
     * set global listener
     */
    protected void setGlobalListeners() {
        syncGroupsListeners = new ArrayList<DataSyncListener>();
        syncContactsListeners = new ArrayList<DataSyncListener>();
        syncBlackListListeners = new ArrayList<DataSyncListener>();

        isGroupsSyncedWithServer = demoModel.isGroupsSynced();
        isContactsSyncedWithServer = demoModel.isContactSynced();
        isBlackListSyncedWithServer = demoModel.isBacklistSynced();

        // create the global connection listener
        connectionListener = new EMConnectionListener() {
            @Override
            public void onDisconnected(int error) {
                EMLog.d("global listener", "onDisconnect" + error);


                if (error == EMError.USER_REMOVED) {
                    onUserException(Constant.ACCOUNT_REMOVED);
                    return;
                } else if (error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
                    onUserException(Constant.ACCOUNT_CONFLICT);
                } else if (error == EMError.SERVER_SERVICE_RESTRICTED) {
                    onUserException(Constant.ACCOUNT_FORBIDDEN);
                }
            }

            @Override
            public void onConnected() {
                // in case group and contact were already synced, we supposed to notify sdk we are ready to receive the events
//                if (isGroupsSyncedWithServer && isContactsSyncedWithServer) {
//                    EMLog.d(TAG, "group and contact already synced with servre");
//                } else {
//                    if (!isGroupsSyncedWithServer) {
                asyncFetchGroupsFromServer(null);
//                    }

//                    if (!isContactsSyncedWithServer) {
                asyncFetchContactsFromServer(null);
//                    }

//                    if (!isBlackListSyncedWithServer) {
                asyncFetchBlackListFromServer(null);
//                    }
//                }
            }
        };

        IntentFilter callFilter = new IntentFilter(EMClient.getInstance().callManager().getIncomingCallBroadcastAction());
        if (callReceiver == null) {
            callReceiver = new CallReceiver();
        }

        //register incoming call receiver
        appContext.registerReceiver(callReceiver, callFilter);
        //register connection listener
        EMClient.getInstance().addConnectionListener(connectionListener);
        //register group and contact event listener
        registerGroupAndContactListener();
        //register message event listener
        registerMessageListener();

    }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:65,代码来源:DemoHelper.java

示例11: setGlobalListeners

/**
 * set global listener
 */
protected void setGlobalListeners(){
    syncGroupsListeners = new ArrayList<DataSyncListener>();
    syncContactsListeners = new ArrayList<DataSyncListener>();
    syncBlackListListeners = new ArrayList<DataSyncListener>();
    
    isGroupsSyncedWithServer = demoModel.isGroupsSynced();
    isContactsSyncedWithServer = demoModel.isContactSynced();
    isBlackListSyncedWithServer = demoModel.isBacklistSynced();
    
    // create the global connection listener
    connectionListener = new EMConnectionListener() {
        @Override
        public void onDisconnected(int error) {
            if (error == EMError.USER_REMOVED) {
                onCurrentAccountRemoved();
            }else if (error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
                onConnectionConflict();
            }
        }

        @Override
        public void onConnected() {
            // in case group and contact were already synced, we supposed to notify sdk we are ready to receive the events
            if(isGroupsSyncedWithServer && isContactsSyncedWithServer){
                EMLog.d(TAG, "group and contact already synced with servre");
            }else{
                if(!isGroupsSyncedWithServer){
                    asyncFetchGroupsFromServer(null);
                }
                
                if(!isContactsSyncedWithServer){
                    asyncFetchContactsFromServer(null);
                }
                
                if(!isBlackListSyncedWithServer){
                    asyncFetchBlackListFromServer(null);
                }
            }
        }
    };

    IntentFilter callFilter = new IntentFilter(EMClient.getInstance().callManager().getIncomingCallBroadcastAction());
    if(callReceiver == null){
        callReceiver = new CallReceiver();
    }

    //register incoming call receiver
    appContext.registerReceiver(callReceiver, callFilter);    
    //register connection listener
    EMClient.getInstance().addConnectionListener(connectionListener);       
    //register group and contact event listener
    registerGroupAndContactListener();
    //register message event listener
    registerMessageListener();
    
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:59,代码来源:DemoHelper.java


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