0

I have a solution to dismiss the ActionSheet from iOS using the RootViewController. But I am unable to crack this for Android as I don't see any class that can give me control on the ActionSheet.

The requirement is to close this action sheet (if it was opened) when the application goes to sleep mode. We bring up the login screen when it wakes up from sleep- but it also shows ActionSheet with the login page since it was not closed. We do not close the current page either, when app sleeps- we keep it in the background, on login we show the last active page again.

Shanand c
  • 67
  • 1
  • 7
  • You could open a foreground service and start a service to listen `ACTION_SCREEN_OFF` and `ACTION_SCREEN_ON` . Check https://stackoverflow.com/questions/9477922/android-broadcast-receiver-for-screen-on-and-screen-off and https://stackoverflow.com/questions/42467885/broadcastreceiver-for-screen-on-off-in-android-when-app-is-not-running . You just need to convert it to C# . – Lucas Zhang Sep 30 '20 at 13:30
  • I got what you mean- I was trying to find a way to dismiss it in Andriod easier way much like how I achieved for iOS from below solution -> https://forums.xamarin.com/discussion/94185/is-there-a-way-to-dismiss-display-alerts-action-sheets-when-the-app-is-entering-background – Shanand c Oct 01 '20 at 06:27
  • Check https://stackoverflow.com/questions/49492018/does-displayactionsheet-exist-in-xamarin-android – Lucas Zhang Oct 01 '20 at 06:31

0 Answers0