我正在尝试从Web服务中的数组填充android中的列表视图我一直收到错误。这是我的代码。在log cat文件中我收到错误:无法打开文件进行阅读。
ListView tv;
public LocationFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_location, container, false);
getView().findViewById(R.id.listView1);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL);
try {
ht.call(SOAP_ACTION, envelope);
View response = (View)envelope.getResponse();
tv.setEmptyView(response);
} catch (Exception e) {
}
return rootView;
}
}