3

我正在尝试在列表视图中列出 json 数据。我的应用程序适用于 froyo 和 blue stacks 模拟器。但它没有在我的手机和我朋友的手机上列出任何东西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);
4

1 回答 1

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

  }
于 2012-11-21T17:19:33.370 回答