Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms android app exit alert

$
0
0

I want when user press 'back button' on android device to exit my app, there is a alert dialog shown to ask user 'Do you want to exit ? (Yes, No)'.

https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.application.pagedisappearing?view=xamarin-forms
I found 'Application.PageDisappearing Event', but I don't know how to write the code.
I have never write the code to work with Event variable.

I need to do the exit alert because my app have TcpClient connection, if the app exit the connection will be disconnect.
I want user use 'home button' to let my app go background, that will be keep the connection alive.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>