Я читаю профессиональную разработку приложений для Android 2 и создаю приложение, которое стоит там. Но когда я запускаю avd и запускаю avd, это всплывает: К сожалению, Earthquake остановился. И затмение LogCat всплывает и я получаю сообщение об ошибке:Проблемы с LogCat
01-26 19:59:11.153: W/dalvikvm(859): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
01-26 19:59:11.183: E/AndroidRuntime(859): FATAL EXCEPTION: main
01-26 19:59:11.183: E/AndroidRuntime(859): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.epstudios.earthquake/com.epstudios.earthquake.Earthquake}: android.os.NetworkOnMainThreadException
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.os.Looper.loop(Looper.java:137)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread.main(ActivityThread.java:4745)
01-26 19:59:11.183: E/AndroidRuntime(859): at java.lang.reflect.Method.invokeNative(Native Method)
01-26 19:59:11.183: E/AndroidRuntime(859): at java.lang.reflect.Method.invoke(Method.java:511)
01-26 19:59:11.183: E/AndroidRuntime(859): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-26 19:59:11.183: E/AndroidRuntime(859): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-26 19:59:11.183: E/AndroidRuntime(859): at dalvik.system.NativeStart.main(Native Method)
01-26 19:59:11.183: E/AndroidRuntime(859): Caused by: android.os.NetworkOnMainThreadException
01-26 19:59:11.183: E/AndroidRuntime(859): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
01-26 19:59:11.183: E/AndroidRuntime(859): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
01-26 19:59:11.183: E/AndroidRuntime(859): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
01-26 19:59:11.183: E/AndroidRuntime(859): at java.net.InetAddress.getAllByName(InetAddress.java:214)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:341)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
01-26 19:59:11.183: E/AndroidRuntime(859): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
01-26 19:59:11.183: E/AndroidRuntime(859): at com.epstudios.earthquake.Earthquake.refreshEarthquakes(Earthquake.java:71)
01-26 19:59:11.183: E/AndroidRuntime(859): at com.epstudios.earthquake.Earthquake.onCreate(Earthquake.java:57)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.Activity.performCreate(Activity.java:5008)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-26 19:59:11.183: E/AndroidRuntime(859): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
01-26 19:59:11.183: E/AndroidRuntime(859): ... 11 more
В чем проблема
'Причиненный: android.os.NetworkOnMainThreadException' Поиск, что это значит, на SO есть много ответов. –