alfo888_ibg
alfo888_ibg

Reputation: 1857

Add bold single Item of ListFragment

I would like to have some Itam of my ListFragment bold and another not (like in the picture below)

the code is:

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

}
 }

Thanks a lot

enter image description here

Upvotes: 0

Views: 253

Answers (1)

jfortunato
jfortunato

Reputation: 12067

You need a custom listadapter. Heres one tutorial http://www.vogella.com/articles/AndroidListView/article.html

Upvotes: 1

Related Questions