Hi All
I can't believe I am asking this question, it should be simple. Below a piece of code in Activity Create, checks for a dir, makes dir. simple. But it is not making the dir.
After chasing my tail for a couple of hours I copied the code from another App where it is working and changed the dir name, no good.
If someone can see what I've done wrong it would be much appreciated.
The error log.
I can't believe I am asking this question, it should be simple. Below a piece of code in Activity Create, checks for a dir, makes dir. simple. But it is not making the dir.
After chasing my tail for a couple of hours I copied the code from another App where it is working and changed the dir name, no good.
If someone can see what I've done wrong it would be much appreciated.
Makedir not working:
'Permission to READ/WRITE External Memory
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
'.... and then
If Result Then 'The HepFile is copied to an external directory where it can transferred/printed etc.
'Copy "Help" file to the "ABT" folder
If File.exists(File.DirRootExternal&"/ABT/","") = False Then File.MakeDir(File.DirRootExternal&"/ABT/","")
File.Copy(File.DirAssets,"helpfile.htm",File.DirRootExternal&"/ABT/","ABTHelp.htm")
End If
The error log.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 586 (Main)
java.io.FileNotFoundException: /storage/emulated/0/ABT/ABTHelp.htm: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:496)
at java.io.FileOutputStream.<init>(FileOutputStream.java:235)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
at anywheresoftware.b4a.objects.streams.File.Copy(File.java:341)
at horsetrailer.B4A.AntennaBearingTool.main$ResumableSub_Activity_Create.resume(main.java:2087)
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:351)
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.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1704)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Last edited: