Friday, 31 August 2018

Network Changed Broadcast Reciver does not executes in One Plus Phones

I have a Broadcast Reciever name "NetworkReciver.java" that executes when Internet is Connected or Disconnected. And it is working well.

But when app is closed from recent apps, then NetworkReciver.java does not executes in One Plus 6 Phone while it works proper in Samsung Phones.

I am not getting why the behaviour is different in One Plus Device

My Code

Manifest

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


  <receiver android:name=".NetworkReciever" >
       <intent-filter>
          <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
       </intent-filter>
  </receiver>

NetworkReciever.java:

  public class NetworkReciever extends BroadcastReceiver 
  {

       @Override
     public void onReceive(Context context, Intent intent)
     {
            Log.i("TAG", "Network REceiver Executed");
     }
}

Problem : NetworkReciever does not execute when app is closed from recent apps in One Plus Device.



from Network Changed Broadcast Reciver does not executes in One Plus Phones

No comments:

Post a Comment