56 lines
2.4 KiB
Java
56 lines
2.4 KiB
Java
package cn.shangyu.gdxzExpert.utils;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
|
|
import cn.shangyu.gdxzExpert.activity.ExitDialog;
|
|
import cn.shangyu.gdxzExpert.widget.ECAlertDialog;
|
|
|
|
|
|
/**
|
|
* Created by WANGChengXin on 2019/12/17.
|
|
*/
|
|
|
|
public class ExitReceiver extends BroadcastReceiver {
|
|
private ECAlertDialog dilaog2 = null;
|
|
|
|
@Override
|
|
public void onReceive(Context context, Intent intent) {
|
|
LogUtil.i("接受到强制退出广播");
|
|
|
|
|
|
Intent it = new Intent();
|
|
it.setClass(context, ExitDialog.class);
|
|
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
context.startActivity(it);
|
|
|
|
// if(dilaog2==null){
|
|
// dilaog2 = ECAlertDialog.buildAlert(CCPAppManager.getContext(),
|
|
// "您的账号出现异常,已经被系统删除,如有疑问请联系肝胆相照工作人员~", "点击退出账号", new DialogInterface.OnClickListener() {// 确定
|
|
// @Override
|
|
// public void onClick(DialogInterface dialog, int which) {
|
|
// // TODO Auto-generated method stub
|
|
// SharePrefUtil.clear(CCPAppManager.getContext(), "isLogin");
|
|
// dilaog2.dismiss();
|
|
// Constant.islogout =1;
|
|
// Intent intent = new Intent(CCPAppManager.getContext(), LoginActivity.class);
|
|
// intent.putExtra("flag", true);
|
|
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
|
// intent.putExtra("phone", SharePrefUtil.getString(CCPAppManager.getContext(), Constant.mobile, ""));
|
|
// CCPAppManager.getContext().startActivity(intent);
|
|
//
|
|
// // 1登入系统 2退出系统 3患者客户端在手机前台运行 4.客户端在手机后台运行
|
|
//
|
|
//// System.exit(0);
|
|
// }
|
|
// });
|
|
// dilaog2.setTitle("温馨提示");
|
|
// dilaog2.setCanceledOnTouchOutside(false);
|
|
// dilaog2.setCancelable(false);
|
|
// dilaog2.getWindow();
|
|
// dilaog2.show();
|
|
// }
|
|
}
|
|
}
|