我有连接到网站的问题。我知道这是连接问题,但我想指出我的智能手机在测试时与网络连接。有时我的应用程序崩溃,我收到此日志消息:
11-15 19:34:41.894: W/System.err(737): java.net.SocketTimeoutException: failed to connect to www.money.pl/212.77.101.20 (port 80) after 3000ms
11-15 19:34:41.904: W/System.err(737): at libcore.io.IoBridge.connectErrno(IoBridge.java:150)
11-15 19:34:41.904: W/System.err(737): at libcore.io.IoBridge.connect(IoBridge.java:112)
11-15 19:34:41.904: W/System.err(737): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
11-15 19:34:41.914: W/System.err(737): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
11-15 19:34:41.914: W/System.err(737): at java.net.Socket.connect(Socket.java:842)
11-15 19:34:41.914: W/System.err(737): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:77)
11-15 19:34:41.914: W/System.err(737): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
11-15 19:34:41.924: W/System.err(737): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
11-15 19:34:41.924: W/System.err(737): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
11-15 19:34:41.924: W/System.err(737): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
11-15 19:34:41.934: W/System.err(737): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
11-15 19:34:41.934: W/System.err(737): at libcore.net.http.HttpEngine.connect(HttpEngine.java:303)
11-15 19:34:41.945: W/System.err(737): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
11-15 19:34:41.945: W/System.err(737): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
11-15 19:34:41.945: W/System.err(737): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
11-15 19:34:41.954: W/System.err(737): at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:512)
11-15 19:34:41.954: W/System.err(737): at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)
11-15 19:34:41.954: W/System.err(737): at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)
11-15 19:34:41.964: W/System.err(737): at org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)
11-15 19:34:41.964: W/System.err(737): at morisson.Notowaniagieldowe.Zmienne$Cena.doInBackground(Zmienne.java:94)
11-15 19:34:41.974: W/System.err(737): at morisson.Notowaniagieldowe.Zmienne$Cena.doInBackground(Zmienne.java:1)
11-15 19:34:41.974: W/System.err(737): at android.os.AsyncTask$2.call(AsyncTask.java:264)
11-15 19:34:41.974: W/System.err(737): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-15 19:34:41.984: W/System.err(737): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-15 19:34:41.984: W/System.err(737): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
11-15 19:34:41.995: W/System.err(737): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
11-15 19:34:41.995: W/System.err(737): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
11-15 19:34:42.034: W/System.err(737): at java.lang.Thread.run(Thread.java:856)
11-15 19:34:42.034: W/dalvikvm(737): threadid=15: thread exiting with uncaught exception (group=0x409bf1f8)
11-15 19:34:42.045: E/AndroidRuntime(737): FATAL EXCEPTION: Thread-85
11-15 19:34:42.045: E/AndroidRuntime(737): java.lang.NullPointerException
11-15 19:34:42.045: E/AndroidRuntime(737): at morisson.Notowaniagieldowe.Tab2Fragment$1.transformacja_ceny(Tab2Fragment.java:70)
11-15 19:34:42.045: E/AndroidRuntime(737): at morisson.Notowaniagieldowe.Tab2Fragment$1.run(Tab2Fragment.java:91)
有人知道如何避免此错误吗?