android.os.NetworkOnMainThreadException

Stack Overflow | faisal1208 | 3 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    NetworkOnMainThreadException

    GitHub | 2 years ago | alexblack
    android.os.NetworkOnMainThreadException
  2. 0
    samebug tip
    This is a bug that happens in Slide in versions 4.2.0 and before. Update to 4.2.2 or further to fix it.
    via GitHub by ccrama
  3. 0

    Checking for internet connectivity in Android app

    Stack Overflow | 1 year ago | Fat Monk
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nooriginalthought.bluebadgeparking/com.nooriginalthought.bluebadgeparking.PreLoadChecks}: android.os.NetworkOnMainThreadException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Permission denied (missing INTERNET permission)

    Stack Overflow | 2 years ago
    java.lang.SecurityException: Permission denied (missing INTERNET permission?)
  6. 0

    eZeeNow.com :: android os networkonmainthreadexception

    ezeenow.com | 2 years ago
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wc.gap.worldcupfixture/com.wc.gap.worldcupfixture.MainActivity}: android.os.NetworkOnMainThreadException
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:1147)
    1 frame
  3. Java RT
    InetAddress.getAllByName
    1. java.net.InetAddress.lookupHostByName(InetAddress.java:418)
    2. java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    3. java.net.InetAddress.getAllByName(InetAddress.java:215)
    3 frames
  4. Android
    HttpURLConnectionImpl.getResponseCode
    1. com.android.okhttp.HostResolver$1.getAllByName(HostResolver.java:29)
    2. com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:232)
    3. com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:124)
    4. com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272)
    5. com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
    6. com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
    7. com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
    8. com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
    8 frames
  5. com.example.accurat
    MainActivity$1.onClick
    1. com.example.accurat.webservice.MainActivity$1.onClick(MainActivity.java:53)
    1 frame
  6. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:4780)
    2. android.view.View$PerformClick.run(View.java:19866)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:135)
    6. android.app.ActivityThread.main(ActivityThread.java:5254)
    6 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  8. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    2 frames