<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - How to prevent app exit by hang up key but from task list? - Comments</title>
 <link>http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list</link>
 <description>Comments for &quot;How to prevent app exit by hang up key but from task list?&quot;</description>
 <language>en</language>
<item>
 <title>Re: How to prevent app exit by hang up key but from task list?</title>
 <link>http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list#comment-42320</link>
 <description>&lt;p&gt;Hi alh, the problem is not as you mentioned. I have set the flag, say iFromKeyEnd, to EFalse while other &lt;br /&gt;
key pressed in the OfferKeyEventL.&lt;br /&gt;
void CMyAppUi::HandleCommandL(TInt aCommand)&lt;br /&gt;
{&lt;br /&gt;
       switch (aCommand)&lt;br /&gt;
      {&lt;br /&gt;
         case EEikCmdExit:&lt;br /&gt;
                  {&lt;br /&gt;
                      // I add codes here, to log the code&lt;br /&gt;
                      CMyLog(&quot;Try to Exit the application&quot;); // CMyLog is the macro defined for logging the text to file.&lt;br /&gt;
                      if ( EFalse == iFromKeyEnd )&lt;br /&gt;
                            Exit();&lt;br /&gt;
                  }&lt;br /&gt;
                   break;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;That is, we first pressed the hang up key, the &quot;Try to Exit the application&quot; will be logged to the file.&lt;br /&gt;
Then try to exit the application from task list, I found it is strange that the log text will not be wrote&lt;br /&gt;
in the log file.&lt;/p&gt;

&lt;p&gt;Is it the reason for the framework for Symbian, the EEikCmdExit event will be only sent once to the &lt;br /&gt;
application?? Or something else wrong??&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Mon, 15 Oct 2007 17:32:00 +0200</pubDate>
 <dc:creator>lorenchen</dc:creator>
 <guid isPermaLink="false">comment 42320 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to prevent app exit by hang up key but from task list?</title>
 <link>http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list#comment-42318</link>
 <description>&lt;p&gt;My guess (if I have understood your problem correctly) is that you simply forget to reset the iFromKeyEnd variable at some suitable point.&lt;/p&gt;

&lt;p&gt;Am I right you set this value in your OfferKeyEventL()?   &lt;br /&gt;
In what cases are the flag reset back to EFalse?&lt;br /&gt;
Will this case(s) happen between you pressing hang-up to switch it to background and you trying to exit from appswitch menu?&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Mon, 15 Oct 2007 14:59:16 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 42318 at http://www.newlc.com</guid>
</item>
<item>
 <title>How to prevent app exit by hang up key but from task list?</title>
 <link>http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list</link>
 <description>&lt;p&gt;I have a requirement that the application should not exit while user pressed hang up key (the red key for end phone calling), &lt;br /&gt;
but it can be exited smoothly from the task list.&lt;/p&gt;

&lt;p&gt;I have tried this way:&lt;br /&gt;
I added a flag for the AppUi that, say TBool iFromKeyEnd, initialized with EFalse, while the hang up key was pressed, &lt;br /&gt;
it will be set as ETrue.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/forum/how-prevent-app-exit-hang-key-task-list#comments</comments>
 <category domain="http://www.newlc.com/en/forums/symbian-c">Symbian C++</category>
 <pubDate>Mon, 15 Oct 2007 04:58:57 +0200</pubDate>
 <dc:creator>lorenchen</dc:creator>
 <guid isPermaLink="false">19289 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
