listview未在ICS上市

时间:2012-11-21 13:29:14

标签: android listview android-4.0-ice-cream-sandwich

我正在尝试在列表视图中列出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);

1 个答案:

答案 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());
            }
           }

  }