2

In My Application, There is functionality of switch application and it works perfectly fine.. But I want to code on switch Application.

At the Time of Pressing switch application, I want to ask " Are you sure you want to Logout? "

Can I do that?

If Yes, then How?

Please help me..

Thanks in Advance.

Riddhi Barbhaya
  • 1,205
  • 1
  • 11
  • 19

1 Answers1

2

It will be hack and a little unexpected behavior but.

When user switch the application the active application goes to background and new one is foregrounded.

Application.deactivate() will be called when your app is scheduled to background. You could request going application to foreground again by 'UiApplication.requestForground()' and show the warning message.

Be careful because this logic should be quite sensitive in case of getting call or calendar event popup. You could imagine how user will be frustrated in this case.

I would have automatic logout after some duration of inactivity instead of your solution. And it would probably useful for people to have option for different intervals or even to switch off it.

Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114
  • Thank you very very much for your reply... I will try once but You are right that I also can do automatic log out after some time of duration. But client's requirement is like that..so i will have to try for it..It seems quite complex what I want to do is..Lets see..Thanks once again.... :))) – Riddhi Barbhaya Jan 11 '13 at 14:42