Note that there are some explanatory texts on larger screens.

plurals
  1. PONot connecting to internet access after force stop the app in android
    primarykey
    data
    text
    <p>I have build an application. my test case is In my Android tab, when I disconnect the wiFi and force stop the app. Now start the application again and connect to wifi again, then my webservices are not responding to wifi and not pushing the records to the server.</p> <p>and the code is..</p> <pre><code>public void onReceive(Context context, Intent intent) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = cm.getActiveNetworkInfo(); if (info != null) { if (info.isConnectedOrConnecting()) { Intent i = new Intent(context, Timeclock.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startService(i); } else { Intent i = new Intent(context, Timeclock.class); context.stopService(i); } } } </code></pre> <p>in Android.manifest.xml file</p> <pre><code>&lt;receiver android:enabled="true" android:name="com.example.timeclock.activity.StartApp" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt; &lt;action android:name="android.net.wifi.STATE_CHANGE"/&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>and in the logcat it is showing as</p> <pre><code>10-22 16:21:08.743: W/System.err(5950): java.net.UnknownHostException: Unable to resolve host "myexample.com": No address associated with hostname 10-22 16:21:08.743: W/System.err(5950): at java.net.InetAddress.lookupHostByName(InetAddress.java:490) 10-22 16:21:08.743: W/System.err(5950): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:281) 10-22 16:21:08.743: W/System.err(5950): at java.net.InetAddress.getAllByName(InetAddress.java:249) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 10-22 16:21:08.743: W/System.err(5950): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) </code></pre> <p>Wifi is not responding even it is available as I checked. So, I want the wifi to make respond to the app after force stop the app. So Please help me to get out of the issue..</p> <p>Thanks in advance..</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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