A AndroidMadhu Active Member Licensed User Jan 4, 2021 #1 Hello, I have created one activity [Act1] and created one file named List.txt. The file can be read successfully from Act1. But if I want to read the file rom Act2 , the error is coming as below : B4X: (FileNotFoundException) java.io.FileNotFoundException: /data/user/0/example.test.example/files/List.txt (No such file or directory) The below is the code from Act1 [Creation of File] : B4X: File.WriteString(File.DirInternal, "List.txt", "resume") Try Log(File.ReadString(File.DirInternal, "List.txt")) Catch Log(LastException) End Try The code from Act2 [read of File] B4X: Try Dim str As String str=File.ReadString(File.DirInternal, "List.txt") If str="resume" Then ResumeActivity=True Log(str) End If File.Delete(File.DirInternal,"List.txt") Catch Log(LastException) End Try Please advice
Hello, I have created one activity [Act1] and created one file named List.txt. The file can be read successfully from Act1. But if I want to read the file rom Act2 , the error is coming as below : B4X: (FileNotFoundException) java.io.FileNotFoundException: /data/user/0/example.test.example/files/List.txt (No such file or directory) The below is the code from Act1 [Creation of File] : B4X: File.WriteString(File.DirInternal, "List.txt", "resume") Try Log(File.ReadString(File.DirInternal, "List.txt")) Catch Log(LastException) End Try The code from Act2 [read of File] B4X: Try Dim str As String str=File.ReadString(File.DirInternal, "List.txt") If str="resume" Then ResumeActivity=True Log(str) End If File.Delete(File.DirInternal,"List.txt") Catch Log(LastException) End Try Please advice
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2021 #2 Don't waste your time... Switch to B4XPages and all these challenges will become trivial. Upvote 0
A AndroidMadhu Active Member Licensed User Jan 4, 2021 #3 @Erel, Definitely we will move to B4XPages.. But we are now at the end of the project where the changes will take a huge time and effort. We are planning to go with B4XPages at our next releases. Meantime could you please advice for any workaround on this? Thanks Upvote 0
@Erel, Definitely we will move to B4XPages.. But we are now at the end of the project where the changes will take a huge time and effort. We are planning to go with B4XPages at our next releases. Meantime could you please advice for any workaround on this? Thanks
josejad Expert Licensed User Longtime User Jan 4, 2021 #4 Your sample works fine here. Works for you the first time you start Act2? Where are you creating the file? Upvote 0
Your sample works fine here. Works for you the first time you start Act2? Where are you creating the file?
klaus Expert Licensed User Longtime User Jan 4, 2021 #5 What are Act1 and Act2? Are these Activities in the same project or are they two different projects? If they are different projects, it will not work. If they are in the same project it should work. Can you reproduce the problem in a small project? Or post your project so we could have a look at it ant see what exactly you have done and how. Upvote 0
What are Act1 and Act2? Are these Activities in the same project or are they two different projects? If they are different projects, it will not work. If they are in the same project it should work. Can you reproduce the problem in a small project? Or post your project so we could have a look at it ant see what exactly you have done and how.