how to stop addContentView to hide the top of my expendablelistview?
I need your help please, I have an expendablelistview in my expendablelistactivity who is hide with my adding do with addContentView. How can I stop that?
I just want my expendablelistview follow my other view.
mAdapter = new MyExpandableListAdapter(con开发者_运维百科text, groups, childrens);
this.setListAdapter(mAdapter);
LayoutInflater inflater = getLayoutInflater();
getWindow().addContentView(inflater.inflate(R.layout.actionbar, null),
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
45));
registerForContextMenu(getExpandableListView());
In an ExpandableListActivity you have an ExpandableListView. Period. When you set the Adapter to it, You can't then add other View on top of that.(I'm almost sure this isn't good practice)
My advice is that you create an ExpadableListView on the side and put it into a Layout(with the other things you want) that is loaded into a clean plain Activity.
Helped? JQCorreia
精彩评论