There is no solution. GPS needs some time to find enough satellites to find a good Position fix. It can take some time.
It does NOT (or much weak) work indoors.
Alternative can be FusedLocationProvider or maybe GeoLocation library. But it only give last known result.