我有延伸类ExpandableListActivity
显示我的数据explandable列表视图,现在我的应用程序支持旧版本,直到API 7如何添加ActionBar
使用getSupportActionBar()
这一类......请帮我
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());
}
}
现在建议我如何去实现它。