S
S
saliev932015-01-26 03:02:30
Java
saliev93, 2015-01-26 03:02:30

FATAL EXCEPTION: main?

There is a form sheet with a list of data from the database, by clicking on any item in the list, the editor window of this item should open, it does not open.
what is the problem? here is the log:

01-25 23:40:40.799: E/AndroidRuntime(1091): FATAL EXCEPTION: main
01-25 23:40:40.799: E/AndroidRuntime(1091): android.os.NetworkOnMainThreadException
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at java.net.InetAddress.getAllByName(InetAddress.java:214)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at com.example.something_that_i_hate.JSONParser.makeHttpRequest(JSONParser.java:53)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at com.example.something_that_i_hate.EditProgramActivity$GetProgramDetails$1.run(EditProgramActivity.java:124)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at android.os.Handler.handleCallback(Handler.java:725)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at android.os.Looper.loop(Looper.java:137)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-25 23:40:40.799: E/AndroidRuntime(1091): 	at dalvik.system.NativeStart.main(Native Method)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2015-01-26
@mbelskiy

dare

B
bimeg, 2015-01-26
@bimeg

In android versions, it seems that with Honecomb'a it was forbidden to climb the network on the main stream. And you can either disable such a check (which you should not do), or move the work with the network to another thread.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question