Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,
    via Stack Overflow by Razgriz

    Happens when you make a network call on the main UI thread of the Android application which results in a UI freeze until the network call is complete and the response is received. Instead, execute the network calls in the background: use AsyncTask.

  2. ,

    An alternative for just getting rid of the Exception is use StrictMode.ThreadPolicy to force execute on main thread.

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);
    

Solutions on the web

via wordpress.com by Unknown author, 1 year ago
Unable to start activity ComponentInfo{com.mkyong.android/com.mkyong.android.SimpleRSSReaderActivity}: android.os.NetworkOnMainThreadException
via Stack Overflow by Xtreme
, 2 years ago
Unable to start activity ComponentInfo{com.mkyong.android/org.androidsoft.games.puzzle.kids.MainActivity}: java.lang.NullPointerException
via Appcelerator JIRA by Stefan Axelsson, 1 year ago
Unable to start activity ComponentInfo{com.derp.herp/com.derp.herp.HerpderpActivity}: android.os.NetworkOnMainThreadException
via Stack Overflow by Todd Painton
, 2 years ago
Unable to start activity ComponentInfo{com.seine.drupal/com.seine.drupal.DrupalTestActivity}: android.os.NetworkOnMainThreadException
via Stack Overflow by Mohammed Al-sadi
, 2 years ago
Unable to start activity ComponentInfo{com.example.json.pwd/com.example.json.pwd.AndroidJSONParsingActivity}: android.os.NetworkOnMainThreadException
via Stack Overflow by febriyanmf
, 2 years ago
Unable to start activity ComponentInfo{dlmbg.pckg.tampil.gambar/dlmbg.pckg.tampil.gambar.TampilkanGambarActivity}: android.os.NetworkOnMainThreadException
android.os.NetworkOnMainThreadException: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)	at java.net.InetAddress.lookupHostByName(InetAddress.java:391)	at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)	at java.net.InetAddress.getAllByName(InetAddress.java:220)	at libcore.net.http.HttpConnection.(HttpConnection.java:71)	at libcore.net.http.HttpConnection.(HttpConnection.java:50)	at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)	at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)	at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)	at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)	at libcore.net.http.HttpEngine.connect(HttpEngine.java:303)	at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)	at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)	at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)	at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)	at com.mkyong.android.SimpleRSSReaderActivity.getInputStream(SimpleRSSReaderActivity.java:92)	at com.mkyong.android.SimpleRSSReaderActivity.onCreate(SimpleRSSReaderActivity.java:42)	at android.app.Activity.performCreate(Activity.java:4465)	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)