<div dir="ltr">You simply have to hide the window on the back button instead of closing it, it should work.</div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-15 9:16 GMT+02:00 ekke <span dir="ltr"><<a href="mailto:ekke@ekkes-corner.org" target="_blank">ekke@ekkes-corner.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Am 15.06.16 um 08:00 schrieb Лагнер,
      Сергей:<br>
    </div><span class="">
    <blockquote type="cite">
      <div dir="ltr">
        <div>Indeed. I have checked it carefully. I call QApplication
          quit if my StackView has the last Page. </div>
        <div>But what should I do to hide the app once user presses the
          back button?</div>
      </div>
    </blockquote></span>
    just noticed:<br>
    if app becomes inactive because user uses Home or Overview Button,
    re-opening is very fast<br>
    if user uses BACK button app is closed and re-opening took a long
    time<br>
    <br>
    you can overwrite BACK behavior:<br>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">        </span><span style="color:#800000">Keys.onBackPressed</span>:<span style="color:#c0c0c0"> </span>{</pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">            </span>event.accepted<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> true</span><span style="font-style:italic;color:#000000"></span></pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">            </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> ...</span></pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">        </span>}</pre>
    <br>
    But I don't know how to set the correct state now to avoid closing
    the app from BACK and doing the same as from HOME<br>
    <br>
    ekke
    <div><div class="h5"><blockquote type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2016-06-15 1:57 GMT+06:00 Xavier Bigand
          <span dir="ltr"><<a href="mailto:flamaros.xavier@gmail.com" target="_blank">flamaros.xavier@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">I don't really understand, because if the
              process isn't killed Android don't release anything that
              you have loaded. So normally when the OS put the
              application back to the active state it should be really
              fast.
              <div><br>
              </div>
              <div>With our app we don't have a such issue.</div>
              <div><br>
              </div>
              <div>Maybe you catch the back button in QML or C++ and you
                call the QApplication quit method or something else that
                finally make your application exiting.</div>
              <div><br>
              </div>
              <div>Try to launch your app with a debugger, you'll see in
                the console if the process is killed when pressing the
                back button.</div>
            </div>
            <div class="gmail_extra">
              <div>
                <div><br>
                  <div class="gmail_quote">2016-06-14 21:31 GMT+02:00
                    Лагнер, Сергей <span dir="ltr"><<a href="mailto:developer@lagner.ru" target="_blank"></a><a href="mailto:developer@lagner.ru" target="_blank">developer@lagner.ru</a>></span>:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">
                        <div>Thank you for advice</div>
                        <div><br>
                        </div>
                        <div>We are already doing our best to optimize
                          QML loading time. We use Loaders from QML
                          side </div>
                        <div>and lazy loading for models from C++ side.
                          But the application still too heavy. </div>
                        <div>It takes 6 sec approximately to launch on
                          Nexus 5. </div>
                        <div><br>
                        </div>
                        <div>Therefore we are looking for other ways to
                          improve our app. </div>
                        <div><br>
                        </div>
                        <div>Now I'm care about warm start. </div>
                        <div><br>
                        </div>
                        <div>Lets consider the following scenario:</div>
                        <div>- I launch the app. It takes 6 sec.</div>
                        <div>- Press back and see a home screen</div>
                        <div>- Launch the app again in a second. And
                          again it takes 6 sec.  </div>
                        <div><br>
                        </div>
                        <div>That is mean that all resources were freed
                          and second start was completely from scratch. </div>
                        <div>I wonder if I could speed up the
                          second(warm) start from java side. </div>
                        <div>For example, is it possible so save
                          preloaded native libraries until the OS has
                          the real lack of memory?</div>
                      </div>
                      <div>
                        <div>
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">2016-06-14 21:56
                              GMT+06:00 Xavier Bigand <span dir="ltr"><<a href="mailto:flamaros.xavier@gmail.com" target="_blank"></a><a href="mailto:flamaros.xavier@gmail.com" target="_blank">flamaros.xavier@gmail.com</a>></span>:<br>
                              <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                <div dir="ltr">Hi,
                                  <div><br>
                                  </div>
                                  <div>If you are using QML you may have
                                    to use Loaders to avoid loading of
                                    GUI parts that are not displayed
                                    directly.</div>
                                  <div>You can also take a look to the
                                    QtQuick compiler to improve qml
                                    loading.</div>
                                  <div>There is a profiler on QtCreator
                                    for QML which can help you to find
                                    your binding that are slow, be sure
                                    to not having binding loops.</div>
                                </div>
                                <div class="gmail_extra"><br>
                                  <div class="gmail_quote">
                                    <div>
                                      <div>2016-06-14 16:33 GMT+02:00
                                        Лагнер, Сергей <span dir="ltr"><<a href="mailto:developer@lagner.ru" target="_blank"></a><a href="mailto:developer@lagner.ru" target="_blank">developer@lagner.ru</a>></span>:<br>
                                      </div>
                                    </div>
                                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                      <div>
                                        <div>
                                          <div dir="ltr">
                                            <div>Hi all.</div>
                                            <div><br>
                                            </div>
                                            <div>I'm trying to optimize
                                              start time of my android
                                              application. For now I'm
                                              interested in warm start
                                              time </div>
                                            <div>when the user presses
                                              back and quickly returns
                                              to the app. If we consider
                                              java application the </div>
                                            <div>warm start is faster,
                                              it seems like android
                                              caches something or so.</div>
                                            <div>But it does not work
                                              for Qt applications. My
                                              application spends
                                              constant time for each
                                              start, even if I closed it
                                              a second ago. </div>
                                            <div><br>
                                            </div>
                                            <div>Is there any way to
                                              optimize warm start of Qt
                                              application? </div>
                                            <div>Any hints are highly
                                              appreciated.</div>
                                            <div><br>
                                            </div>
                                            <div>Thanks,</div>
                                            <div>Sergey</div>
                                          </div>
                                          <br>
                                        </div>
                                      </div>
_______________________________________________<br>
                                      Android-development mailing list<br>
                                      <a href="mailto:Android-development@qt-project.org" target="_blank">Android-development@qt-project.org</a><br>
                                      <a href="http://lists.qt-project.org/mailman/listinfo/android-development" rel="noreferrer" target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a><br>
                                      <br>
                                    </blockquote>
                                  </div>
                                  <span><font color="#888888"><br>
                                      <br clear="all">
                                      <div><br>
                                      </div>
                                      -- <br>
                                      <div data-smartmail="gmail_signature">
                                        <div dir="ltr">Xavier</div>
                                      </div>
                                    </font></span></div>
                              </blockquote>
                            </div>
                            <br>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <div><br>
                  </div>
                </div>
              </div>
              <span><font color="#888888">-- <br>
                  <div data-smartmail="gmail_signature">
                    <div dir="ltr">Xavier</div>
                  </div>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Android-development mailing list
<a href="mailto:Android-development@qt-project.org" target="_blank">Android-development@qt-project.org</a>
<a href="http://lists.qt-project.org/mailman/listinfo/android-development" target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <br>
    </div></div><span class="HOEnZb"><font color="#888888"><div>-- <br>
      <p style="margin-bottom:0cm"> <font color="#808080" face="Verdana, sans-serif"> <font size="4">
            ekke </font><font size="1"><br>
          </font> </font> </p>
    </div>
  </font></span></div>

<br>_______________________________________________<br>
Android-development mailing list<br>
<a href="mailto:Android-development@qt-project.org">Android-development@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/android-development" rel="noreferrer" target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Xavier</div></div>
</div>