Xamarin android 13, Popup permission notification and Popup

345 Views Asked by At

enter image description here

Hi developer,

Can i call this function for check permission and request permission popup in other file cs ? spesifik permission notification, photos and videos At the moment only can call this function in mainactivity.cs?

I have a need to call the function in other page ex : after login.

because this function it is called in mainactivity.cs so popup it will be called when the application open, can i call it other cs file than in mainactivity.cs ?

please help Thankyou.

Xamarin Android Developer

1

There are 1 best solutions below

2
Jessie Zhang -MSFT On

Can i call this function for check permission and request permission popup in other file cs ? At the moment only can call this function in mainactivity.cs?

Yes, you can call the function to check permissions and request permissions in other pages as you need.

For more information about Permissions in Xamarin.Android, you can check document Permissions In Xamarin.Android.

Besides, you can also use Xamarin.Essentials nuget to achieve this. The Permissions class in Xamarin.Essentials nuget provides the ability to check and request runtime permissions.

This API uses runtime permissions on Android. Please ensure that Xamarin.Essentials is fully initialized and permission handling is setup in your app.

For more information, you can check document Xamarin.Essentials: Permissions.