我想填充從Web服務中的數組在android中的列表視圖我不斷收到錯誤。這是我的代碼。在日誌貓文件中出現錯誤:無法打開文件進行讀取。Android的列表視圖:從Web服務的數組
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;
}
}
我們可以看到整個相關堆棧跟蹤,並且您能指出它抱怨哪一行嗎? –