简体   繁体   English

在没有活动的情况下渲染 HTML

[英]Rendering HTML without an activity

I'd like to render some HTML for the side effects of such rendering (ie pinging a backend server).我想渲染一些 HTML 来解决这种渲染的副作用(即 ping 后端服务器)。 When my activity is visible, of course I can just show the HTML in a WebView.当我的活动可见时,我当然可以在 WebView 中显示 HTML。 However, when the activity is not visible, I want to render the HTML without showing the activity as this would be disruptive to the user.但是,当活动不可见时,我想渲染 HTML 而不显示活动,因为这会对用户造成干扰。

Is this possible to do on Android?这可以在 Android 上做到吗?

Look at the classes/interfaces in org.apache.http for ways of handling HTTP actions without using a WebView.查看 org.apache.http 中的类/接口,了解在不使用Z39107D1668CAE2A6F2的情况下处理 HTTP 操作的方法。

You could place your code in an Android Service which will run without interrupting the user.您可以将代码放在 Android 服务中,该服务将在不中断用户的情况下运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM