Note that there are some explanatory texts on larger screens.

plurals
  1. POIntentService not receiving network state change intents
    primarykey
    data
    text
    <p>In my AndroidManifest.xml I have the following...</p> <pre><code>&lt;service android:name=".MyIntentService" &gt; &lt;intent-filter&gt; &lt;action android:name="android.net.wifi.STATE_CHANGE" /&gt; &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;" &lt;action android:name="com.mycompany.myapp.TEST" /&gt; &lt;/intent-filter&gt; &lt;/service&gt; &lt;receiver android:name=".MyNetworkMonitor" &gt; &lt;intent-filter&gt; &lt;action android:name="android.net.wifi.STATE_CHANGE" /&gt; &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;" &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>Ideally I'd like the IntentService to 'wake' and interpret the Intent(s) broadcast by the system when either the wi-fi or mobile internet services change state....but it doesn't.</p> <p>The BroadcastReceiver does receive the Intents, however, and I can get it to send a broadcast intent (<code>com.mycompany.myapp.TEST</code>) to wake my IntentService and tell it there has been a change in network state.</p> <p>So the question is, why won't my IntentService wake from the system intent broadcasts informing of network state change but it will wake from a broadcast from my BroadcastReceiver. Confused.</p> <p><strong>EDIT:</strong> This is what you get for trying to code at nearly 5am (oops). For some reason I thought the <code>com.mycompany.myapp.TEST</code> intent was working as a broadcast.</p> <p>What I'm actually doing is <code>Intent i = new Intent ("com.mycompany.myapp.TEST")</code> and then using <code>startService(i)</code> which works because of the <code>&lt;intent-filter&gt;</code> entry (even without explicitly specifying <code>MyIntentService.class</code> in the Intent). This is what was confusing the issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload