<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 7, 2016, at 2:51 PM, Federico Buti <<a href="mailto:bacarozzo@gmail.com" class="">bacarozzo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Hi,</p><p dir="ltr" class="">>Show a toast with "tap again to quit" on the first tap and then quit on the second tap. That's the common behavior of closing app. It would help in avoiding accidental closing and confirming to the user that the app is really going to be quit</p></div></blockquote><div><br class=""></div>Thanks for toast tip!</div><div><br class=""></div><div>-Ed<br class=""><div><br class=""></div><br class=""><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><p dir="ltr" class="">Cheers,<br class="">
F.</p>
<div class="gmail_extra"><br class=""><div class="gmail_quote">On Oct 7, 2016 9:39 PM, "Eddie Sutton" <<a href="mailto:eddie.of.the.spam@gmail.com" class="">eddie.of.the.spam@gmail.com</a>> wrote:<br type="attribution" class=""><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><div class="elided-text"><blockquote type="cite" class=""><div class="">On Oct 7, 2016, at 2:26 PM, Gianluca <<a href="mailto:gmaxera@gmail.com" target="_blank" class="">gmaxera@gmail.com</a>> wrote:</div><br class="m_4408679170655203984Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class=""><br class="m_4408679170655203984Apple-interchange-newline">Il giorno 07 ott 2016, alle ore 20:19, Eddie Sutton <<a href="mailto:eddie.of.the.spam@gmail.com" target="_blank" class="">eddie.of.the.spam@gmail.com</a>> ha scritto:</div><br class="m_4408679170655203984Apple-interchange-newline"><div class=""><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 7, 2016, at 2:15 PM, Gianluca <<a href="mailto:gmaxera@gmail.com" target="_blank" class="">gmaxera@gmail.com</a>> wrote:</div><br class="m_4408679170655203984Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class=""><br class="m_4408679170655203984Apple-interchange-newline">Il giorno 07 ott 2016, alle ore 20:09, Eddie Sutton <<a href="mailto:eddie.of.the.spam@gmail.com" target="_blank" class="">eddie.of.the.spam@gmail.com</a>> ha scritto:</div><br class="m_4408679170655203984Apple-interchange-newline"><div class=""><div style="word-wrap:break-word" class=""><div class="">Thank you for your reply Jason.</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 7, 2016, at 1:01 PM, Jason H <<a href="mailto:jhihn@gmx.com" target="_blank" class="">jhihn@gmx.com</a>> wrote:</div><br class="m_4408679170655203984Apple-interchange-newline"><div class=""><div class=""><div style="font-family:Verdana;font-size:12px" class=""><div class=""><div class="">It seems like the activity catches it and removes itself from the stack.</div><div class="">Is it crashing? If so paste the exception.</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I think maybe you are correct.</div><div class=""><br class=""></div><div class="">I see no exceptions in adb.  Instead it appeared the app was closed deliberately.  </div><div class=""><br class=""></div><div class="">Perhaps the problem is that I do not understand the Android back button.  Does an Android user expect the back button to close an app?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><pre style="margin-top:0px;margin-bottom:0px" class=""><font color="#ff2600" class="">D/TSR     (25898): ../source/source/mainwindow.<wbr class="">cpp:812 (virtual void tcmw::<b class="">MainWindow::closeEvent</b>(<wbr class="">QCloseEvent*)): ************************* C L O S E ******************</font></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><br class=""></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><font color="#ff2600" class="">I/ActivityManager(  563): Process com.ditchwitch.tsr (pid 25898) (adj 9) has died.</font></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><font color="#ff2600" class="">I/WindowState(  563): WIN DEATH: Window{42c61a48 u0 com.ditchwitch.tsr/com.<wbr class="">ditchwitch.tsr.tsractivity.<wbr class="">TsrActivity}</font></pre><pre style="margin-top:0px;margin-bottom:0px" class="">W/WindowManager(<span style="color:rgb(192,192,192)" class="">  </span>563):<span style="color:rgb(192,192,192)" class=""> </span>Force-removing<span style="color:rgb(192,192,192)" class=""> </span>child<span style="color:rgb(192,192,192)" class=""> </span>win<span style="color:rgb(192,192,192)" class=""> </span>Window{42caa3f8<span style="color:rgb(192,192,192)" class=""> </span>u0<span style="color:rgb(192,192,192)" class=""> </span>SurfaceView}<span style="color:rgb(192,192,192)" class=""> </span>from<span style="color:rgb(192,192,192)" class=""> </span>container<span style="color:rgb(192,192,192)" class=""> </span>Window{42c61a48<span style="color:rgb(192,192,192)" class=""> </span>u0<span style="color:rgb(192,192,192)" class=""> </span>com.ditchwitch.tsr/com.<wbr class="">ditchwitch.tsr.tsractivity.<wbr class="">TsrActivity}</pre><div class=""><br class=""></div></div><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I expected Android button to retain my app state, suspend app to background, then restore suspended state when reactivated.</div></div></div></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">Default behavior of Android on back button is to terminate the application.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">If you don’t want this behavior you have to capture the back button and handle.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">This is not Qt thing … it happens also if you are programming in Java.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="http://www.androiduipatterns.com/2011/03/back-button-behavior.html" target="_blank" class="">http://www.androiduipatterns.<wbr class="">com/2011/03/back-button-<wbr class="">behavior.html</a></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">So most Android users will be irritated if I intercept the back button and do not let the app close??</div><div class=""><br class=""></div><div class="">I thought the Android back button was supposed to back-track through the apps the user had opened before the current app.</div></div></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">:-D one thing is what the Android system does by default … another is what the users except :-D</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">So, what users except are:</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""> - if the app is its very first screen, pressing back button will exit from the app and go to the home screen but when the user will open the app again is expecting to see exactly the same state as before like the app was in the background. So you should save the status and restart the app has it should never been stopped.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""> - if the app is into an internal page, pressing back button will just navigate backward into the history (or app views structure) without exiting from the app.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">But unfortunately this is up to the programmers to do into the Android world :-(</div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="">I think since my UI is a tab control, I will let the app close and any Bluetooth discovered devices or Bluetooth connections will be closed.</div><div class=""><br class=""></div><div class="">Then re-launching will re-start the app at the default tab and users will have to scan again for B;bluetooth devices.</div><div class=""><br class=""></div><div class=""><div class="">Thank you for taking time to explain it to me!</div><div class=""><br class=""></div></div><div class="elided-text"><div class="">-Ed</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class=""><div class=""><div style="font-family:Verdana;font-size:12px" class=""><div class=""><div class=""><div name="quote" style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left-width:2px;border-left-style:solid;border-left-color:rgb(195,217,229);word-wrap:break-word" class=""><div name="quoted-content" class=""><div class=""><div class="">>Has anyone seen this?</div><div class=""> </div>I cannot find any useful clues in adb.<div class=""> </div><div class="">The app terminates unless I add a keyReleaseEvent to accept the Key_Back.<div class=""> </div><div class=""> </div><div class=""><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">#if</span><span style="color:rgb(192,192,192)" class=""> </span>defined(<span style="color:rgb(0,0,128)" class="">Q_OS_ANDROID</span>)</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span><span style="color:rgb(192,192,192)" class="">  </span><span style="color:rgb(0,0,128)" class="">Android</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">back</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">button</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">kills</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">TSR</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">?</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">Adding</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">a</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">keyReleaseEvent</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">that</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">accepts</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">the</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">event</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">prevents</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">the</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">crash.</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">I</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">do</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">not</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">understand</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">reason</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">why.</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">Ignoring</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">the</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">Android</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">back</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">button</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">will</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">annoy</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">users</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">but</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">is</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">better</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">than</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,0,128)" class="">crashing.</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">///</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(128,128,0)" class="">void</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(128,0,128)" class="">MainWindow</span>::<span style="font-style:italic" class="">keyReleaseEvent</span>(<span style="color:rgb(128,0,128)" class="">QK<wbr class="">eyEvent</span><span style="color:rgb(192,192,192)" class=""> </span>*event)</pre><pre style="margin-top:0px;margin-bottom:0px" class="">{</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(192,192,192)" class="">    </span><span style="color:rgb(128,128,0)" class="">if</span>(<span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(128,0,128)" class="">Qt</span>::<span style="color:rgb(128,0,128)" class="">Key_Back</span><span style="color:rgb(192,192,192)" class=""> </span>==<span style="color:rgb(192,192,192)" class=""> </span>event->key())</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(192,192,192)" class="">    </span>{</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(192,192,192)" class="">        </span><span style="color:rgb(0,0,128)" class="">qDebug</span>(<span style="color:rgb(0,128,0)" class="">"Android</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,128,0)" class="">Back</span><span style="color:rgb(192,192,192)" class=""> </span><span style="color:rgb(0,128,0)" class="">button"</span>);</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(192,192,192)" class="">        </span>event->setAccepted(<span style="color:rgb(128,128,0)" class="">true</span>);</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(192,192,192)" class="">    </span>}</pre><pre style="margin-top:0px;margin-bottom:0px" class="">}</pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">#endif</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""> </pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">Thanks in advance,</span></pre><pre style="margin-top:0px;margin-bottom:0px" class=""> </pre><pre style="margin-top:0px;margin-bottom:0px" class=""><span style="color:rgb(0,0,128)" class="">-Ed</span></pre><div class=""> </div></div></div>______________________________<wbr class="">_________________ Interest mailing list<span class="m_4408679170655203984Apple-converted-space"> </span><a href="mailto:Interest@qt-project.org" target="_blank" class="">Interest@qt-project.org</a><span class="m_4408679170655203984Apple-converted-space"> </span><a href="http://lists.qt-project.org/mailman/listinfo/interest" target="_blank" class="">h<wbr class="">ttp://lists.qt-project.org/<wbr class="">mailman/listinfo/interest</a></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div>______________________________<wbr class="">_________________<br class="">Interest mailing list<br class=""><a href="mailto:Interest@qt-project.org" target="_blank" class="">Interest@qt-project.org</a><br class=""><a href="http://lists.qt-project.org/mailman/listinfo/interest" target="_blank" class="">http://lists.qt-project.org/<wbr class="">mailman/listinfo/interest</a></div></blockquote></div></blockquote></div></div></div></blockquote></div></blockquote></div></div><br class=""></div><br class="">______________________________<wbr class="">_________________<br class="">
Interest mailing list<br class="">
<a href="mailto:Interest@qt-project.org" class="">Interest@qt-project.org</a><br class="">
<a href="http://lists.qt-project.org/mailman/listinfo/interest" rel="noreferrer" target="_blank" class="">http://lists.qt-project.org/<wbr class="">mailman/listinfo/interest</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>