Switching to other app causes dialog 'OK' event
Login to reply to this topic.
lun, 2005-01-31 12:37
Joined: 2004-05-26
Forum posts: 72
Situation: I have an app (on the P900) that synchronizes data between the PDA and an external database. This app displays a dialog to allow the user to change settings. This dialog has two buttons: OK and Cancel (with the default IDs). The Cancel button is the default button. When the user presses the OK button, the synchronization process starts:

Code:
button_id = dlg->ExecuteLD(dialog_resource);
if ( button_id == EEikBidOk )
{
// Start the sync process
}

No problem so far. However, when the user switches to another application while the dialog is shown, the dialog returns with button id EEikBidOk. Which causes the synchronization process to start...

I tried redefining the HandleForegroundEventL method, and set a flag when the application goes to the background, and only start the sync process when the application is in the foreground, but apparently this method gets called after the dialog returns...

Is there a way to detect if the dialog returned because the user actually pressed a button, or because the application was switched to the background?

-- arno

ven, 2005-03-04 06:41
Joined: 2005-03-03
Forum posts: 52
Implement the ShutL function of CEikDialog

copyright 2003-2009 NewLC SARL