gpt4 book ai didi

java - 手机状态接收器在 Oppo 中不工作

转载 作者:太空宇宙 更新时间:2023-11-04 11:27:10 25 4
gpt4 key购买 nike

我创建了一个基本应用程序来检查手机状态更改时是否收到广播,但它不起作用。我也尝试过调用和接听电话。我意识到这些是 Vivo、Honor 等设备的常见问题。这是 list

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jss.servicetester">

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".ReceiverMe">

<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>

</receiver>



</application>

</manifest>

这是接收器的代码:

package jss.servicetester;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
* Created by DELL WORLD on 5/28/2017.
*/

public class ReceiverMe extends BroadcastReceiver {
String LOGTAG = "Receiver";
@Override
public void onReceive(Context context, Intent intent) {
Log.d(LOGTAG, "action:" + intent.getAction());

}
}

谁能帮帮我。

最佳答案

在对应用程序的电池选项进行一些更改后,开始在 oppo F3 中工作。就像在后台解冻应用程序一样。

关于java - 手机状态接收器在 Oppo 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44224667/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com