问题描述
转到列表时无显示,全屏为灰黑状态无报错预期能显示表头,和“noanydata”publicclassFavoriteextendsListActivity{privateArrayList<HashMap<String,String>>mItems=null;privatefinalString[]mColumnNames={"Name","Size","DownloadTime"};privatefinalint[]mViewIds={R.id.txtName,R.id.txtSize,R.id.txtTime};publicvoidOnCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.favorite);//设定表头this.getListView().addHeaderView(this.getLayoutInflater().inflate(R.layout.favorite_header,null),null,false);//设置数据适配器mItems=newArrayList<HashMap<String,String>>();HashMap<String,String>map=newHashMap<String,String>();map.put("hohai","2011.10.1");mItems.add(map);//addItem("hohaiuniversity","1kb","2011.10.1");ListAdapteradapter=newSimpleAdapter(Favorite.this,mItems,R.layout.favorite_row,mColumnNames,mViewIds);setListAdapter(adapter);}}