running值设置为True

running值设置为True

本文介绍了QT 5机器人,更改background_running值设置为True的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何元数据值从QT项目更改的机器人部署。我需要的background_running设置为true。我可以做手工,和一切正常,但接下来的时间我改变code,这个值被重置为假。

任何人都知道如何从QT项目,所以价值code之间变化仍然存在编辑这些值?

 <! - 后台运行 - >
        < - 警告:此值更改为真,则可能会导致意外崩溃,如果
                      应用程序仍然尝试后得出
                      applicationStateChanged(QT :: ApplicationSuspended)
                      信号被发送! - >
        <元数据机器人:名字=android.app.background_running机器人:值=FALSE/>


解决方案

我终于想通了这一点。

从Qt Creator中,进入项目 - > Android的编译选项 - >在构建Android的详细APK

点击创建模板,确保gradle这个选择,现在你可以编辑该模板AndroidManifest.xml中,设置选项设置为true。所有未来的构建将使用此AndroidManifest.xml中。您也可以现在可以轻松地通过编辑清单延长QtActivity。

Does anyone know how to change the meta-data values from the QT project for an android deploy. I need to set the background_running to true. I can do that manually, and everything works, but the next times I change the code, this value is reset back to false.

Anyone know how to edit these values from the QT project so the value persists between code changes?

        <!-- Background running -->
        <!-- Warning: changing this value to true may cause unexpected crashes if the
                      application still try to draw after
                      "applicationStateChanged(Qt::ApplicationSuspended)"
                      signal is sent! -->
        <meta-data android:name="android.app.background_running" android:value="false"/>
解决方案

I finally figured this out.

From QT creator, go into projects -> android build options -> Details on build android APK

Click create templates, ensure gradle is selected, now you can edit the template AndroidManifest.xml and set the option to true. All future builds will use this AndroidManifest.xml. You can also now easily extend the QtActivity by editing the manifest.

这篇关于QT 5机器人,更改background_running值设置为True的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 15:55