ListView不显示

时间:2011-04-22 08:25:18

标签: android listview onconfigurationchanged

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  setContentView(R.layout.layout_currently);
  if(dHolder.getCurrentItems() == null)
  {
      defineView();
      new LoadCurrent().execute(currentItems);
  }
  else
  {
      try {
          ArrayList<CurrentlyItem> privateCItem = dHolder.getCurrentItems();
          Log.d("ListSize", "There is " + privateCItem.size() + " elements on list");
          int resID = R.layout.current_item;
          Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
          aa = new CurrentAdapter(this, resID, privateCItem, display.getRotation());
          currentListView = (ListView)findViewById(R.id.currentListView);
          currentListView.setAdapter(aa);
          aa.notifyDataSetChanged();
    } catch (Exception e) {
        Log.d(" - ERROR", e.toString());
    }

  }
}

这是一个应该处理屏幕旋转的代码......一切都没有错误,但是列表视图没有显示...我收到带有140个元素的ArrayList(由代码中的Log.d报告)但是对于某些原因列表视图不显示...

感谢您的回答!

0 个答案:

没有答案