A Alessandra Pellegri Active Member Licensed User Longtime User Nov 10, 2015 #1 My application is associated with some file extension. So if I open one of these files from file manager or email the app starts. The problem is that after I open a file, every time my app pauses and resumes, it believes that I am opening that file again. In other words, my code is : Code: Sub Activity_Create(FirstTime As Boolean) .... .... Dim in As Intent in = Activity.GetStartingIntent If in.IsInitialized Then If in.GetData <> Null Then If in.GetData<>"" Then ... .... .... If in.GetData was different from "" the first time that I launch the app (because I am opening a file), it will be different from "" every time that the app resumes from pause. How could I solve that? Thank you
My application is associated with some file extension. So if I open one of these files from file manager or email the app starts. The problem is that after I open a file, every time my app pauses and resumes, it believes that I am opening that file again. In other words, my code is : Code: Sub Activity_Create(FirstTime As Boolean) .... .... Dim in As Intent in = Activity.GetStartingIntent If in.IsInitialized Then If in.GetData <> Null Then If in.GetData<>"" Then ... .... .... If in.GetData was different from "" the first time that I launch the app (because I am opening a file), it will be different from "" every time that the app resumes from pause. How could I solve that? Thank you
Erel B4X founder Staff member Licensed User Longtime User Nov 10, 2015 #2 This code should go to Activity_Resume. You can store the last intent as a process global variable and then check whether the current intent is different than the previous one or not. Upvote 0
This code should go to Activity_Resume. You can store the last intent as a process global variable and then check whether the current intent is different than the previous one or not.
A Alessandra Pellegri Active Member Licensed User Longtime User Nov 10, 2015 #3 But doing so if I really open two times the same file it doesn't work nomore. Isn't it ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2015 #4 No. It is not related to the file name. It is just a way to guarantee that you are not handling the same intent twice. Upvote 0
No. It is not related to the file name. It is just a way to guarantee that you are not handling the same intent twice.
A Alessandra Pellegri Active Member Licensed User Longtime User Nov 11, 2015 #5 Thank you. Now it's working Upvote 0