android.os.NetworkOnMainThreadException

Stack Overflow | eluo7 | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    UnsupportedEncodingException

    Stack Overflow | 8 months ago | eluo7
    android.os.NetworkOnMainThreadException
  2. 0

    Android : can't load my XML file and app crashes

    Stack Overflow | 5 years ago | Rob
    android.os.NetworkOnMainThreadException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Java URL getContent Android

    Stack Overflow | 3 years ago | CamelopardalisRex
    android.os.NetworkOnMainThreadException
  5. 0

    Downloading string content of Webpage

    Stack Overflow | 2 years ago
    java.lang.IllegalStateException: Could not execute method of the activity
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.os.NetworkOnMainThreadException

    No message provided

    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork()
  2. Android Platform
    StrictMode$AndroidBlockGuardPolicy.onNetwork
    1. android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1144)
    1 frame
  3. Java RT
    InetAddress.getAllByName
    1. java.net.InetAddress.lookupHostByName(InetAddress.java:385)
    2. java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
    3. java.net.InetAddress.getAllByName(InetAddress.java:214)
    3 frames
  4. Android
    HttpURLConnectionImpl.getInputStream
    1. libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
    2. libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
    3. libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
    4. libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
    5. libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
    6. libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
    7. libcore.net.http.HttpEngine.connect(HttpEngine.java:311)
    8. libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
    9. libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
    10. libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:282)
    11. libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
    11 frames
  5. com.jluo80.amazinggifter
    AmazonSearchActivity.onCreate
    1. com.jluo80.amazinggifter.URLReader.sendGet(URLReader.java:24)
    2. com.jluo80.amazinggifter.EbayDriver.run(EbayDriver.java:46)
    3. com.jluo80.amazinggifter.AmazonSearchActivity.onCreate(AmazonSearchActivity.java:46)
    3 frames
  6. Android Platform
    ActivityThread.main
    1. android.app.Activity.performCreate(Activity.java:5369)
    2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
    3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
    4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
    5. android.app.ActivityThread.access$700(ActivityThread.java:165)
    6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
    7. android.os.Handler.dispatchMessage(Handler.java:99)
    8. android.os.Looper.loop(Looper.java:137)
    9. android.app.ActivityThread.main(ActivityThread.java:5450)
    9 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:525)
    2 frames
  8. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
    2 frames
  9. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(Native Method)
    1 frame