I am trying to implement 'exit' key through event handling using Device Class, and behind exit button i try to call a function with these lines.
var Core::Group dialog = (Core::Group)FindCurrentDialog();
DismissDialog( dialog, null, null, null, null, null, false );
but it doesnot dismiss the dialog and returns from the following lines inside DismissDialog function:
if ( dialogStack == null )
why is my dialogStack empty? where can i be possibly wrong?
PS: i am trying to implement hardware button 'exit' using application variant class.