本文整理汇总了Java中com.hyphenate.EMError.USER_LOGIN_ANOTHER_DEVICE属性的典型用法代码示例。如果您正苦于以下问题:Java EMError.USER_LOGIN_ANOTHER_DEVICE属性的具体用法?Java EMError.USER_LOGIN_ANOTHER_DEVICE怎么用?Java EMError.USER_LOGIN_ANOTHER_DEVICE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.hyphenate.EMError
的用法示例。
在下文中一共展示了EMError.USER_LOGIN_ANOTHER_DEVICE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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();
}
});
}
}
示例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);
}
}
示例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);
}
}
示例5: onDisconnected
@Override
public void onDisconnected(int i) {
if (i == EMError.USER_LOGIN_ANOTHER_DEVICE) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
startActivity(LoginActivity.class);
toast(getString(R.string.user_login_another_device));
}
});
}
}
示例6: onDisconnected
@Override
public void onDisconnected(int error) {
if (error == EMError.USER_REMOVED || error == EMError.USER_LOGIN_ANOTHER_DEVICE) {
isConflict = true;
} else {
handler.sendEmptyMessage(0);
}
}
示例7: 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();
}
});
}
}
示例8: 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();
}
示例9: 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);
}
}
示例10: 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();
}
});
}
}
示例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) {
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();
}
示例12: 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();
}