Android Question Refresh GPS Data

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello,
Probably elementary problem but that I can not solve in the attached example.
My app consists of 3 Activities.
-Activity 1: Home
- Activity 2: Locate my GPS position at a time T1
- Activity 3: Locate My GPS position at time T2
I can't refresh the GPS data in Activity 2 or 3 when I close the app or when I switch from activity 2 to 3, I always find the same data.
Probably Activity_Pause and Activity_Resume which I don't know how to handle in this app.
Thank you for your help.
 

Attachments

  • Localiser2.zip
    15.7 KB · Views: 206

ciginfo

Well-Known Member
Licensed User
Longtime User
Thank you. I've tried with B4XPages but I'm not used to it yet. I don' know where i have to declare "Dim rp As RuntimePermissions".
"Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)" crashes !!
 

Attachments

  • B4XLocaliser.zip
    16 KB · Views: 199
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
Hi,
Without B4XPages I am using Fileprovider.bas and RunTimePermissions. I declare in Process_Global of the "Starter module" Public Provider As FileProvider & Public rp As RuntimePermissions.
With B4XPages how to declare and handle FileProvider in the example posted in my previous post.
"Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)" crashes !! normal.
Thank you
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
In your project you do not have a RuntimePermissions object in Starter, but you have several else where. I would tidy that up before you do anything else.
It is all right, and a bit neater, to have one in ClassGlobals in each B4XPage and reference that one when needed or you could check just once in B4XMainPage.Initialize.
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
I am not comfortable with B4XPages which is new to me.
Can you answer my first post by trying the example attached in the first post.
Thank you
 
Upvote 0
Top