<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://forums.garmin.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/developer/connect-iq/f/discussion/233354/app-re-enter-after-exit-on-fenix-5</link><description>Hi, 
 I&amp;#39;m developing an watch app and a strage thing occured. Dispite using Menu object I implemented my own one basing on an integer tracing the user selection. 
 In particular I have 3 options: go_back, discard_and_quit, save_and_quit... go_back works</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Jul 2020 15:00:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://forums.garmin.com/developer/connect-iq/f/discussion/233354/app-re-enter-after-exit-on-fenix-5" /><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1107060?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 15:00:18 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:4f25c851-b563-4a94-ae35-ab5311f526cb</guid><dc:creator>jim_m_58</dc:creator><description>&lt;p&gt;Do this instead of using the menu to exit, of add a null check for session.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1107012?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:51:39 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:24078a58-0a9f-4b8b-b0c8-137cf3e25560</guid><dc:creator>edocit</dc:creator><description>&lt;p&gt;using that function simulator raise&lt;/p&gt;
&lt;p&gt;&amp;quot;a class method was invoked on a Session that is no longer valid&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1107006?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:41:28 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:cf7d1f67-05a5-4a70-ae6f-2685fbade77e</guid><dc:creator>jim_m_58</dc:creator><description>&lt;p&gt;So in your WatchUi.BehaviuorDelegate have&amp;nbsp;&lt;/p&gt;
&lt;p&gt;functiononBack() {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; session.stop();&lt;/p&gt;
&lt;p&gt;&amp;nbsp; session.discard();&amp;nbsp;&lt;/p&gt;
&lt;p&gt;return false:&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106982?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:12:24 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:47f4f91f-2498-4a8b-8f4a-4f00245a07c6</guid><dc:creator>edocit</dc:creator><description>&lt;p&gt;I didn&amp;#39;t push a menu but I implemented that as a Layout in XML then I started a timer that every X milliseconds triggers a WatchUi.requestUpdate() then I have an integer that from the view in the onUpdate(dc) calls the onLayout(dc)&amp;nbsp; and uses that integer to dispatch one of the layouts described in the XML.&lt;/p&gt;
&lt;p&gt;So I have no delegate for the menu but everything is handled by the press of physichal keys in the WatchUi.BehaviourDelegate that changes the integer (FSM state) and then allows, on the update called on timer period expired, to change the GUI. This is the only Delegate I have in my app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106978?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:03:51 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:0e4f1856-8ef6-4d68-b204-02777c21d575</guid><dc:creator>jim_m_58</dc:creator><description>&lt;p&gt;Yes, but in the delegate where you also bring up your menu, so the same place.&lt;/p&gt;
[quote userid="277138" url="~/developer/connect-iq/f/discussion/233354/app-re-enter-after-exit-on-fenix-5/1106923"]I&amp;nbsp;missed returning true in the onKey() in the class testDelegate that extends WatchUi.BehaviorDelegate&amp;nbsp; but however unfortunately nothing changed[/quote]
&lt;p&gt;What if instead of pushing your menu, you just stop and discard the session, then call exit()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106970?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 12:52:08 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:286984fd-c6ae-40e8-b217-9e03266a7b9d</guid><dc:creator>edocit</dc:creator><description>&lt;p&gt;yes I stop the recording with session.stop() before both session.save() or session.discard() or session.start() (in case of resume).&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand exactly what you mean for the callback in the onBack()... Do you mean something like the code below ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;class testDelegate extends WatchUi.BehaviorDelegate {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;function onBack(){ return false; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;If this code above is correct nothing happens when ESC key is pressed (I tested that on the simulator because at the moment I&amp;#39;ve no access to the Fenix 5). One more detail; the application works properly on the simulator, it has this strange behavior only in the real watch.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106928?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 11:25:33 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:ada1154f-a7d6-48a3-a276-394921250db8</guid><dc:creator>jim_m_58</dc:creator><description>&lt;p&gt;If you add a callback for onBack(), and return false, what happens if you hit the back button&amp;nbsp;to exit?&lt;/p&gt;
&lt;p&gt;Also, before you do session.save() or session.discard(), you&amp;#39;ve stopped the recording, correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106923?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 11:14:31 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:855ac89f-7858-4973-b123-425d6d3cf0e0</guid><dc:creator>edocit</dc:creator><description>&lt;p&gt;I&amp;nbsp;missed returning true in the onKey() in the class testDelegate that extends WatchUi.BehaviorDelegate&amp;nbsp; but however unfortunately nothing changed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App re-enter after exit on Fenix 5</title><link>https://forums.garmin.com/thread/1106541?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 17:44:58 GMT</pubDate><guid isPermaLink="false">a9571b57-dd57-479e-8763-8f8a603e40aa:c4c0bd55-1b7d-4b26-8df9-2255644d0faa</guid><dc:creator>jim_m_58</dc:creator><description>&lt;p&gt;The first place I&amp;#39;d look in the input delegate and make sure you are returning a true/false as needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>