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 GitHub by schrockblock
, 1 year ago
via GitHub by jehy
, 1 year ago
This exception has no message.
via Stack Overflow by Unknown author, 2 years ago
This exception has no message.
via Stack Overflow by anonymous
, 2 years ago
via GitHub by DavidEdwards
, 11 months ago
This exception has no message.
via GitHub by luchuantao
, 4 months ago
This exception has no message.
android.os.NetworkOnMainThreadException: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)	at java.net.SocketOutputStream.write(SocketOutputStream.java:157)	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)	at java.io.BufferedWriter.flush(BufferedWriter.java:254)	at java.io.PrintWriter.newLine(PrintWriter.java:482)	at java.io.PrintWriter.println(PrintWriter.java:629)	at java.io.PrintWriter.println(PrintWriter.java:740)	at de.badaix.snapcast.control.TcpClient.sendMessage(TcpClient.java:72)	at de.badaix.snapcast.control.RemoteControl.setVolume(RemoteControl.java:222)	at de.badaix.snapcast.MainActivity.onVolumeChanged(MainActivity.java:583)	at de.badaix.snapcast.ClientItem.onProgressChanged(ClientItem.java:93)	at android.widget.SeekBar.onProgressRefresh(SeekBar.java:93)	at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1327)	at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1382)	at android.widget.ProgressBar.setProgressInternal(ProgressBar.java:1447)	at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:850)	at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:778)	at android.view.View.dispatchTouchEvent(View.java:9939)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:411)