【发布时间】:2014-02-25 07:07:20
【问题描述】:
我有一个扩展 ExpandableListActivity 的类以将我的数据显示为可解释的列表视图,现在我的应用程序支持旧版本直到 API 7 如何使用 getSupportActionBar() 添加 ActionBar 到这个类...请帮帮我
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());
}
}
现在建议我如何实现它。
【问题讨论】:
标签: android android-actionbar android-support-library android-actionbar-compat