For a start this is wrong. You should be testing result as well as the permission you were requesting
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = rp.PERMISSION_WRITE_EXTERNAL_STORAGE Then
ATLAS10MapMaken
End If
End Sub
You can also use Wait For instead
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE) ' Implicit read capability if granted
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
Also you don't need to test permission in your second Activity - you've already done it in Main and should rely on that.
This code is wrong. You are not requesting a valid permission type and in fact you don't need to request permission for GetSafeDirDefaultExternal anyway.
rp.CheckAndRequest(rp.GetSafeDirDefaultExternal("ATLAS10"))
For some reason you are setting activity height and width, this is unnecessary.
You seem to have added manifest permissions that you do not need to.
Attached is a version of your test app with a cleaned up Main and manifest. UNINSTALL YOUR APP before trying it to reset the permissions. Note that requesting PERMISSION_WRITE_EXTERNAL_STORAGE asks the user for access to "photos and media" which if you allow will return True but the ATLAS10 folder will not be created as this does not give you access to the full file system. Targeting SDK 28 it would ask for access to "photos, media and files" - note the difference - and ATLASS10 will be created.
When playing with permissions it is important to UNINSTALL youar app each time as permissions carry over installs.
Thanks so far,
I tried your version and I got the same error as before:
Error occurred on line: 50 (TEST)
java.lang.RuntimeException: Object should first be initialized (TextReader).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.streams.File$TextReaderWrapper.ReadLine(File.java:641)
at Permission.Test.test$ResumableSub_Button1_Click.resume(test.java:503)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.keywords.Common$1.onClick(Common.java:490)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:188)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
** Activity (test) Pause, UserClosed = true **