0

我创建了一个锁屏应用程序,当我尝试解锁手机时,我的锁屏活动正在显示,但问题是当有人打电话给我时,如果锁屏活动正在显示,来电或警报没有显示。

谁能告诉我,有什么问题吗?

清单文件:

    <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
        <uses-permission android:name="android.permission.VIBRATE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.GET_TASKS"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
        <uses-permission android:name="android.permission.WAKE_LOCK"/>
        <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
        <uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
        <uses-permission android:name="android.permission.VIBRATE"/>
        <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
        <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.USES_POLICY_FORCE_LOCK"/>
        <uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
        <uses-permission android:name="android.permission.REORDER_TASKS" />

<activity
            android:name=".OneActivity"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            android:showOnLockScreen="true"
            android:configChanges="keyboardHidden|orientation"
            android:theme="@style/noActionBar"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
        </activity>

<receiver android:name=".utils.ReciverUnlockScreen" android:enabled="true" android:exported="false"/>
4

1 回答 1

0

当您显示 LockScreen 时,您必须检查“TelephonyManager.getCallState()”以验证是否有活动的传入/传出呼叫。

于 2018-07-19T06:37:03.860 回答