我有一个 LogCat 错误,但我不明白。该应用程序运行良好,但随后随机发生。我尝试将 adMob 添加到我的应用程序中,然后出现此错误,因此我删除了 add mob 的所有内容,但仍然收到此错误!这是什么意思?
09-30 22:05:33.299: E/AndroidRuntime(30293): FATAL EXCEPTION: main
09-30 22:05:33.299: E/AndroidRuntime(30293): android.os.NetworkOnMainThreadException
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1178)
09-30 22:05:33.299: E/AndroidRuntime(30293): at java.net.InetAddress.lookupHostByName(InetAddress.java:394)
09-30 22:05:33.299: E/AndroidRuntime(30293): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:245)
09-30 22:05:33.299: E/AndroidRuntime(30293): at java.net.InetAddress.getAllByName(InetAddress.java:220)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:590)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:510)
09-30 22:05:33.299: E/AndroidRuntime(30293): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:488)
09-30 22:05:33.299: E/AndroidRuntime(30293): at library.JSONParser.getJSONFromUrl(JSONParser.java:42)
09-30 22:05:33.299: E/AndroidRuntime(30293): at library.UserFunctions.loginUser(UserFunctions.java:54)
09-30 22:05:33.299: E/AndroidRuntime(30293): at com.example.LoginActivity$1.onClick(LoginActivity.java:52)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.view.View.performClick(View.java:3549)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.view.View$PerformClick.run(View.java:14393)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.os.Handler.handleCallback(Handler.java:605)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.os.Handler.dispatchMessage(Handler.java:92)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.os.Looper.loop(Looper.java:154)
09-30 22:05:33.299: E/AndroidRuntime(30293): at android.app.ActivityThread.main(ActivityThread.java:4945)
09-30 22:05:33.299: E/AndroidRuntime(30293): at java.lang.reflect.Method.invokeNative(Native Method)
09-30 22:05:33.299: E/AndroidRuntime(30293): at java.lang.reflect.Method.invoke(Method.java:511)
09-30 22:05:33.299: E/AndroidRuntime(30293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-30 22:05:33.299: E/AndroidRuntime(30293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-30 22:05:33.299: E/AndroidRuntime(30293): at dalvik.system.NativeStart.main(Native Method)