0

我已经使用 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 模式时,我会触发打开呼叫活动的意图但是当手机处于锁定状态并且有人打电话时,它会显示锁定屏幕,然后显示我的呼叫活动

任何人都知道如何解决它。

4

1 回答 1

2

我在Android源代码中搜索过

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.3.1_r1/com/android/phone/InCallScreen.java?av=f

添加WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED活动开始。

于 2013-06-05T13:28:53.310 回答