Error with using Jsoup library for Android
<p>I used this library for Android already, but today I need to create app for Android version 3 (for Tablet; I used it for mobile lately) I try to use this code:</p>

<pre><code>package com.dad.aaa;

import java.io.IOException;

import org.json.JSONArray;
import org.json.JSONException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import android.app.Activity;
import android.os.Bundle;

public class Qwerty11Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Document doc = null;
        try {
            doc = Jsoup.connect("http://mailquail.com/view_lists/list_json/d/d").get();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
            JSONArray lists=new JSONArray(doc.text());
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>But it doesn't work and send me exception:</p>

<pre><code>10-07 15:18:37.724: ERROR/AndroidRuntime(1289): FATAL EXCEPTION: main
10-07 15:18:37.724: ERROR/AndroidRuntime(1289): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dad.aaa/com.dad.aaa.Qwerty11Activity}: android.os.NetworkOnMainThreadException
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread.access$1500(ActivityThread.java:123)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.os.Looper.loop(Looper.java:126)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread.main(ActivityThread.java:3997)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at java.lang.reflect.Method.invokeNative(Native Method)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at java.lang.reflect.Method.invoke(Method.java:491)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at dalvik.system.NativeStart.main(Native Method)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289): Caused by: android.os.NetworkOnMainThreadException
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1077)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at java.net.InetAddress.lookupHostByName(InetAddress.java:481)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:281)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at java.net.InetAddress.getAllByName(InetAddress.java:249)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:69)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:48)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:304)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:292)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:274)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:217)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:377)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:364)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:143)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at org.jsoup.helper.HttpConnection.get(HttpConnection.java:132)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at com.dad.aaa.Qwerty11Activity.onCreate(Qwerty11Activity.java:22)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
10-07 15:18:37.724: ERROR/AndroidRuntime(1289):     ... 11 more
</code></pre>

<p>Permission for internet was added. </p>
