It is normal for the system to do things without waiting for the GPS to return.
Firstly, getting a fix does take time: the GPS sensor needs to identify several satellites signals and correlate their position, this can takes 10 seconds or more. But also there are instances where you cannot get a GPS signal at all (you are in tunnel, in the basement of a building, in a parking garage, whatever).
If the system was to linger until it got a signal, it would be there stuck and your only way to regain control would be to terminate the app.
You don;t want that.
So the GPS is asynchronous. You issue a request to get a fix, and the GPS function will call you when it gets the data; meanwhile, your program can carry on doing whatever else you need, even if this whatever is you having it display “acquiring satellite; please stand by”.
What you do is something like this:
The system will no hang around with the GPS location request (for the record, this whole getGPS function could be a button click instead, as opposed to be a function called by a button click, or the result of a call from another function, including the start or load screen) and the program will keep running doing whatever other stuff it is programmed to do.
When the GPS sensor returns something, it will go back in the function at the “then do” level. It does not matter if your app is taking pictures and trying to geotag them at that moment, if there is an error, it will display a message that it could not get a GPS fix. Then, it will call the function “whattodowithfailedGPS” (which you could call anything you want, and do whatever you program it to do in the case you cannot get a GPS fix).
If you do NOT have an error, then you get the latitude, longitude and location data, and do whatever you want with them by passing them to your other function “whattodo” with that GPS data.
By definition, “whattodo” will never start UNTIL you get the GPS data.