标签:
boolean result = false; ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); ComponentName cn = am.getRunningTasks(2).get(0).topActivity; if (cn != null) { if ("com.android.phone.InCallScreen".equals(cn.getClassName())) { result = true; } } return result;
需要加入权限:
<uses-permission android:name="android.permission.GET_TASKS" />
标签:
原文地址:http://www.cnblogs.com/wolipengbo/p/4208794.html