InputStream "lags/stuns" app for a while
<p>I have ProgressBar in my Activity, and it is spinning all the time. I'm trying to connect to avaliable web page -
I use InputStream</p>

<p><code>InputStream input = new URL(url).openStream();</code></p>

<p>to get my desired URL. It's working fine. Except one situation: when it starts loading, and I turn off internet connection while this is loading/processing (which not easy to turn it off right in the time, but also not hard), the Progressbar stops spinning, because app is something like 'freezed'. So you can't even quit it with back button. After few seconds, like 3-4, the ProgressBar is spinning again and app is unfreezed and fully working.
LogCat only prints that app skipped many frames.</p>

<p>Code:</p>

<pre><code>new Thread(new Runnable()
{
      public void run()
      {
            try
            {
                InputStream input = new URL(url).openStream();
                ...

            } catch (IOException e)
            {
                e.printStackTrace();
            }
      }
 }).start();
</code></pre>

<p><strong>Edit:</strong> I'm using Jsoup to read received webpage. So I tried </p>

<p><code>Jsoup.connect(url).get();</code></p>

<p>too, but same problem as above... </p>

<p>LogCat:</p>

<blockquote>
  <p>Skipped 614 frames!</p>
</blockquote>

<p><strong>Log2</strong></p>

<pre><code>10-14 17:25:16.365 26460-26460 D/libEGL: loaded /system/lib/egl/libEGL_mali.so
10-14 17:25:16.375 26460-26460 D/libEGL: loaded /system/lib/egl/libGLESv1_CM_mali.so
10-14 17:25:16.375 26460-26460 D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so
10-14 17:25:16.395 26460-26460 D/OpenGLRenderer: Enabling debug mode 0
10-14 17:25:27.406 26460-26460 I/Choreographer: Skipped 603 frames!  The application may be doing too much work on its main thread.
</code></pre>