java.lang.IllegalArgumentException:索引0处的scheme中的非法字符:

时间:2013-03-01 06:08:16

标签: android

如果在ics上运行(2.3运行良好),我会遇到这样的错误:

03-01 10:15:58.217: E/AndroidRuntime(844): FATAL EXCEPTION: AsyncTask #5
03-01 10:15:58.217: E/AndroidRuntime(844): java.lang.RuntimeException: An error occured while executing doInBackground()
03-01 10:15:58.217: E/AndroidRuntime(844):  at android.os.AsyncTask$3.done(AsyncTask.java:278)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.lang.Thread.run(Thread.java:856)
03-01 10:15:58.217: E/AndroidRuntime(844): Caused by: java.lang.IllegalArgumentException: Illegal character in scheme at index 0:   http://localhost/android/data_janji.php?id_nasabah=40
03-01 10:15:58.217: E/AndroidRuntime(844):  at java.net.URI.create(URI.java:727)
03-01 10:15:58.217: E/AndroidRuntime(844):  at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:75)
03-01 10:15:58.217: E/AndroidRuntime(844):  at com.mpegadaian.JSONParser.makeHttpRequest(JSONParser.java:109)
03-01 10:15:58.217: E/AndroidRuntime(844):  at com.mpegadaian.DaftarJanjiActivity$LoadGadai.doInBackground(DaftarJanjiActivity.java:132)
03-01 10:15:58.217: E/AndroidRuntime(844):  at com.mpegadaian.DaftarJanjiActivity$LoadGadai.doInBackground(DaftarJanjiActivity.java:1)

我检查了data_janji.php以查看我是否访问了跨表单浏览器,结果很好:

{"data_janji":[{"nama_brg":"ANTING ANTING 10GR","id_janji":"9","id_gadai":"23","tgl_janji":"01-March-2013","pesan":"tebus bsk"}]}

如何解决这个问题?

1 个答案:

答案 0 :(得分:85)

您似乎在http:前面有一些空格(空格),请将其删除。