0

在这里,我正在尝试使用一项 Web 服务。我正在尝试将来自该 Web 服务的 json 数据显示到 android 的 listview 中?但我在我的 logcat 上遇到错误,如下所示

日志猫

03-18 18:11:51.830: I/System.out(296): Transparent  17170445
03-18 18:11:51.990: W/System.err(296): java.net.SocketException: Permission denied
03-18 18:11:52.000: W/System.err(296):  at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)
03-18 18:11:52.000: W/System.err(296):  at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)
03-18 18:11:52.000: W/System.err(296):  at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)
03-18 18:11:52.000: W/System.err(296):  at java.net.Socket.checkClosedAndCreate(Socket.java:873)
03-18 18:11:52.010: W/System.err(296):  at java.net.Socket.connect(Socket.java:1020)
03-18 18:11:52.010: W/System.err(296):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
03-18 18:11:52.010: W/System.err(296):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
03-18 18:11:52.010: W/System.err(296):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
03-18 18:11:52.010: W/System.err(296):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
03-18 18:11:52.010: W/System.err(296):  at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
03-18 18:11:52.010: W/System.err(296):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:146)
03-18 18:11:52.010: W/System.err(296):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
03-18 18:11:52.010: W/System.err(296):  at com.example.png.StationsListActivity.callService(StationsListActivity.java:97)
03-18 18:11:52.010: W/System.err(296):  at com.example.png.StationsListActivity$3.run(StationsListActivity.java:78)
03-18 18:11:52.429: D/AndroidRuntime(296): Shutting down VM
03-18 18:11:52.429: W/dalvikvm(296): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-18 18:11:52.449: E/AndroidRuntime(296): FATAL EXCEPTION: main
03-18 18:11:52.449: E/AndroidRuntime(296): java.lang.NullPointerException
03-18 18:11:52.449: E/AndroidRuntime(296):  at com.example.png.StationsListActivity$1.handleMessage(StationsListActivity.java:43)
03-18 18:11:52.449: E/AndroidRuntime(296):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-18 18:11:52.449: E/AndroidRuntime(296):  at android.os.Looper.loop(Looper.java:123)
03-18 18:11:52.449: E/AndroidRuntime(296):  at android.app.ActivityThread.main(ActivityThread.java:4627)
03-18 18:11:52.449: E/AndroidRuntime(296):  at java.lang.reflect.Method.invokeNative(Native Method)
3-18 18:11:52.449: E/AndroidRuntime(296):   at java.lang.reflect.Method.invoke(Method.java:521)
 03-18 18:11:52.449: E/AndroidRuntime(296):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-18 18:11:52.449: E/AndroidRuntime(296):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-18 18:11:52.449: E/AndroidRuntime(296):  at dalvik.system.NativeStart.main(Native Method)

感谢您宝贵的时间!..

4

3 回答 3

3

您是否在您的 中添加了以下权限manifest.xml

<uses-permission android:name="android.permission.INTERNET" />
于 2013-03-18T12:50:47.903 回答
0

将 Internet 权限添加到您的清单:

<uses-permission android:name="android.permission.INTERNET"/>
于 2013-03-18T12:51:33.873 回答
0

请将 Internet 权限添加到您的 manifest.xml 文件。

<uses-permission android:name="android.permission.INTERNET"/>
于 2013-03-18T13:05:36.340 回答