【发布时间】:2013-01-15 19:49:47
【问题描述】:
所以我看到你可以像这样制作一个执行 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 平板电脑在我使用 Web 应用程序时不会关闭屏幕?就像我说的,我尝试将 LinearLayout 代码放入我的 web.xml 中,但它给了我很多错误。谢谢。
【问题讨论】:
-
LinearLayout 适用于 android 布局文件,不适用于服务器端 web.xml 文件。您是否试图找到代码放入网页中,告诉浏览器不要让手机关机?
-
就是这个想法。他们将使用蓝牙扫描仪扫描条形码,目前工作正常。但是,应用程序不会将扫描识别为实际的屏幕活动,因为他们没有触摸它,所以它会在大约一分钟后关闭。
标签: android jquery-mobile screen