简体   繁体   中英

Android application terminates after activity.finish() in Xamarin

I have a specific render for the page FacebookFriends that is called like this:

await Navigation.PushAsync(new FacebookFriends());

and then my render for android of that page

[assembly: ExportRenderer(typeof(PinBuster.FacebookFriends), typeof(PinBuster.Droid.FacebookFriends))]

when I call :

var activity = this.Context as Activity;
activity.Finish();

the application shuts down. Does anyone know why? shouldn't it go back to the previous page?

I think you have only one activity in Xamarin.Android project. So whenever you are finishing that activity your application was terminating.

Because of only one activity in your application, it was terminating your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM