2017-05-28 79 views
1

我创建了一个基本的应用程序来检查电话状态改变时是否收到广播,但它不工作。我尝试了拨打电话和来电。我意识到这些都是体内,荣誉等常见问题这里是清单电话状态接收器不工作在Oppo

<?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()); 

    } 
} 

谁能帮我。

回答

0

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