Cannot get permissions when using PermissionsManager. I'm trying:
Where is my mistake?
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
AddApplicationText(
<provider
android:name="igolub.permissionmanager.b4a.PMFileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
AddPermission(android.permission.DANGEROUS_WRITE_EXTERNAL_STORAGE)
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Check
End Sub
Sub Check
Dim PM As PermissionsManager
PM.CheckAndRequestPermission(PermissionsManager.DANGEROUS_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
Log(Permission)
End If
End Sub