gpt4 book ai didi

Android 防止屏幕关闭

转载 作者:搜寻专家 更新时间:2023-11-01 09:01:42 24 4
gpt4 key购买 nike

所以我看到你可以像这样制作一个执行 LinearLayout 的 xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:keepScreenOn="true">
</LinearLayout>

我的问题是:我正在做一个 jQuery Mobile 应用程序,我想我可以把它放在我的 web.xml 文件中。但是,当我尝试这样做时,我总是遇到错误。这是我的 web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<!-- The definition of the Root Spring Container shared by all Servlets
and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml,
/WEB-INF/spring/appServlet/security-context.xml</param-value>
</context-param>

<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

有没有更简单的方法可以让我的 Android 平板电脑在我使用网络应用程序时不会关闭屏幕?正如我所说,我尝试将 LinearLayout 代码放入我的 web.xml 中,但它给了我很多错误。谢谢。

最佳答案

Is there an easier way to make it so my Android tablet will not turn off the screen while I am in the web application?

这是不可能的。事实上,如果任意网站以这种方式影响设备,那将是非常令人不安的。

如果您选择创建 native 应用程序,甚至可能是 PhoneGap 应用程序,那么您可以考虑尝试控制屏幕是否关闭。

关于Android 防止屏幕关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14630388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com