application permissions

Hi all
Help with the problem that has arisen. Previously, to enable write permission to local storage, I wrote this:


using Android.Support.V4.Content;
using Android.Support.V4.App;


protected override void Initialize()
{
//Request to enable permissions
if (ContextCompat.CheckSelfPermission(Activity, Manifest.Permission.ReadExternalStorage) != (int)Permission.Granted)
{
// Permission has never been accepted
// So, I ask the user for permission
ActivityCompat.RequestPermissions(Activity, new String { Manifest.Permission.ReadExternalStorage }, PERMISSION_REQUEST_READ_EXTERNAL_STORAGE);
}
base.Initialize();
}

And everything worked well.

And after switching to version 3.8.1 errors appeared
изображение

And in the method:

Has anyone encountered this? And how did you solve the problem?

1 Like