Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RequestPermissions not showing dialog box xamarin c#

I'm new to xamarin. I found lot of similar topics and i tried them. but non of them work for xamarin.

I added the permission in the AndroidManifest for OS below Android M

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

and I used This document and implemented the code below.

string[] permissions ={Manifest.Permission.ReadExternalStorage};
ActivityCompat.RequestPermissions(Activity, permissions, STORAGE_REQUEST_CODE);

ActivityCompat.RequestPermissions doesn't show the dialog box.

like image 252
Tharindu Wanninayake Avatar asked Jun 12 '18 10:06

Tharindu Wanninayake


1 Answers

I found the solution for my problem

RequestPermissions(new String[] { Manifest.Permission.ReadExternalStorage }, STORAGE_REQUEST_CODE);
like image 200
Tharindu Wanninayake Avatar answered Nov 16 '22 02:11

Tharindu Wanninayake