我已经使用 PhoneStateListener 自定义了呼叫屏幕
case TelephonyManager.CALL_STATE_RINGING:
// called when someone is ringing to this phone
AppLog.e(TAG,"Ringing");
i1 = new Intent(ctx, IncomingScreenActivity.class);
if(mcurrentTheme.equals("")||mcurrentTheme.equals("default")){
AppLog.e(TAG, "Either Default Theme or SharedPreference is not Available");
} else {
ActivityManager localActivityManager = (ActivityManager) ctx.getSystemService("activity");
for (String str = ((ActivityManager.RunningTaskInfo) localActivityManager
.getRunningTasks(1).get(0)).topActivity
.flattenToString();; str = ((ActivityManager.RunningTaskInfo) localActivityManager
.getRunningTasks(1).get(0)).topActivity
.flattenToString()) {
if ((!str.contains("com.android.phone.InCallScreen")))
continue;
AppLog.d("IncomingCallPlus",
"*****************************************************");
i1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i1.putExtra("incoming", incomingNumber);
i1.setAction("com.cygnet.ThemeApp.action");
ctx.startActivity(i1);
return;
}
因此,当状态为 Rining 模式时,我会触发打开呼叫活动的意图但是当手机处于锁定状态并且有人打电话时,它会显示锁定屏幕,然后显示我的呼叫活动
任何人都知道如何解决它。