QuickReturn活动中的ListView?活动中2个视图中的难度

时间:2013-12-29 15:14:07

标签: android listview android-listview android-fragments

大家好我想在一个活动中使用QuickReturn ListView。下面给出的链接使用一个片段来做它。

  

http://www.androidviews.net/2012/12/quickreturn-listview/

所以基本上我被困在这里: -

View view = inflater.inflate(R.layout.fragment, null);
View mHeader = inflater.inflate(R.layout.header, null);

我无法找到替代方法,以便我可以如何更改上面的代码,以便它可以在活动中使用? 事情是快速返回ListView用于不同的视图并将它们拼接在一起,然后在片段中处理它们,我无法在活动的情况下进行。

1 个答案:

答案 0 :(得分:0)

要从活动内部获取根视图:

View rootView = getWindow().getDecorView().findViewById(android.R.id.content)

从内部活动中获取inflater:

LayoutInflater layoutInflater = this.getLayoutInflater();

希望这有帮助,如果没有,请告诉我。