我正在尝试在列表视图中列出json数据。我的应用程序适用于froyo和蓝色堆栈模拟器。但是我的手机上的ListView
和我朋友的手机上都没有列出任何内容(两者都是ICS)
ListView list = (ListView) findViewById(R.id.lstEcz);
SimpleAdapter mSchedule = new SimpleAdapter(
this, nobList, R.layout.nob_eczane,
new String[] { "istasyon", "adres", "tel", "ilce" },
new int[] { R.id.tvEczAd, R.id.tvEczAdres, R.id.tvEczTel, R.id.tvEczIlce }
);
list.setAdapter(mSchedule);
答案 0 :(得分:1)
public class getInternet extends AsyncTask<String, Void, Void>
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
Utils.ShowProgressDialog();
}
@Override
protected Void doInBackground(String... arg0)
{
try
{
//your json parsing code...
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result)
{
super.onPostExecute(result);
try
{
Utils.hideProgressDialog();
list.setAdapter(mSchedule);
}
catch (Exception e)
{
Log.v("log", e.toString());
}
}
}