I have a class which extends ExpandableListActivity
to display my data as explandable list view, now my app supporting older version till API 7 how to add ActionBar
using getSupportActionBar()
to this class...Please help me out
public class Facts extends ExpandableListActivity {
public void onCreate(Bundle savedInstanceState) {
try{
super.onCreate(savedInstanceState);
setContentView(R.layout.facts);
SimpleExpandableListAdapter expListAdapter =
new SimpleExpandableListAdapter(
this,
createGroupList(), // Creating group List.
R.layout.facts_grouprow, // Group item layout XML.
new String[] { "questions" }, // the key of group item.
new int[] { R.id.row_name }, // ID of each group item.-Data under the key goes into this TextView.
createChildList(), // childData describes second-level entries.
R.layout.facts_childrow, // Layout for sub-level entries(second level).
new String[] {"answers"}, // Keys in childData maps to display.
new int[] { R.id.grp_child} // Data under the keys above go into these TextViews.
);
setListAdapter(expListAdapter); // setting the adapter in the list
}catch(Exception e){
System.out.println("Errrr +++ " + e.getMessage());
}
}
now suggest me to how to achieve it.