好吧,我正在使用loopj库上传多个表单数据,但问题是它给了我java.io.UnknownHost异常,尽管我尝试了与邮递员相同的查询并且它成功提交了数据。请帮我解决问题,它淹没了我。
public void submit() {
progressDialog.setMessage("Please Wait, Inserting Data on Server");
progressDialog.show();
File myFile = new File(selectedImageUri.getPath().toString());
RequestParams params = new RequestParams();
try {
params.put("image", myFile);
params.put("id", "" +104);
params.put("latitude", "33333");
params.put("longitude", "55555");
params.put("task_status", "3");
params.put("remarks", "dilievered");
} catch (FileNotFoundException e) {
}
AsyncHttpClient client = new AsyncHttpClient();
client.setTimeout(60000);
client.put(ProcessTask.this,WebServicesURLS.UPDATE_TASK, params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
progressDialog.dismiss();
Toast.makeText(ProcessTask.this, "Succesfuly updated", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
progressDialog.dismiss();
Toast.makeText(ProcessTask.this, "Failed"+statusCode, Toast.LENGTH_SHORT).show();
}
});
}
日志猫图像.....
网址格式不正确。请检查WebServicesURLS.UPDATE_TASK参考下是否有正确的网址。