2013-01-18 66 views
0

大膽的單個項目,我想有我ListFragment大膽一些亞依淡而另一個不 (如下面圖片)添加ListFragment

代碼:

public class ItemListFragment extends ListFragment { 

     @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     DummyItem i0 = new DummyItem("0", "Welcome" + S.getUsername()); 
     DummyContent.addItem(i0); 

       //useless code 

     DummyItem ichat = new DummyItem(String.valueOf(j), "Table Chat"); 
     DummyContent.addItem(ichat); 
     j++; 
     DummyItem iblackboard = new DummyItem(String.valueOf(j), "Black Board"); 
     DummyContent.addItem(iblackboard); 
     setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(), 
      android.R.layout.simple_list_item_activated_1, 
      android.R.id.text1, DummyContent.ITEMS)); 

} 
} 

非常感謝

enter image description here

回答