Android keepScreenOn和合并布局

Android keepScreenOn和合并布局,android,layout,merge,include,Android,Layout,Merge,Include,我正在使用合并布局,keepScreenOn似乎不起作用。你能给我一些建议吗? 示例代码: <merge xmlns:android="http://schemas.android.com/apk/res/android" android:keepScreenOn="true"> <include layout="@layout/abc"/> <include layout="@layout/def"/> </merge>

我正在使用合并布局,keepScreenOn似乎不起作用。你能给我一些建议吗? 示例代码:

<merge xmlns:android="http://schemas.android.com/apk/res/android" 
android:keepScreenOn="true">

    <include layout="@layout/abc"/>
    <include layout="@layout/def"/>
</merge>

谢谢你,Ladislav。

在合并中没有名为keepScreenOn的属性可用。android:keepScreenOn=“true”可用于布局

创建
标签的目的是通过减少视图树中的级别数来优化Android布局


keepScreenOn
属性控制视图窗口在可见时是否应保持屏幕打开

我找到了解决办法。keepScreenOn应该在java代码、onCreate方法而不是xml中设置


Ladislav.

好的,但是如何使用布局和合并使屏幕处于打开状态呢?