所以我看到,你可以做,做的LinearLayout像这样的XML:Android的防止屏幕在关闭
<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>
有没有使它所以当我在Web应用程序Android平板电脑不会关闭屏幕更简单的方法?就像我说的,我试着将LinearLayout代码放到我的web.xml中,并且给了我很多错误。谢谢。
LinearLayout适用于android布局文件,不适用于服务器端web.xml文件。 您是否试图找到代码放入网页,告诉浏览器不要让手机关机? – harmanjd
这就是这个想法。他们将使用蓝牙扫描仪扫描条形码,目前它工作正常。但是,应用程序不会将扫描视为实际的屏幕活动,因为它们没有触摸它,所以在大约一分钟后关闭。 – snowfi6916