因为要增加当apk不运行或者任务stack还存在,但不是运行状态时,收到好友发送的信息,也要弹出一个对话框显示信息。下面的代码可以判断当前的apk运行状态。
/** Get system service ActivityManager */ ActivityManager manager = (ActivityManager) ctx.getSystemService(Activity.ACTIVITY_SERVICE); /** * Get current running task stack list, the latest will be the top one