Skip to content

Commit

Permalink
conflict with fragment and activity solved. hope it works
Browse files Browse the repository at this point in the history
  • Loading branch information
nawinkhatiwada committed Dec 30, 2019
1 parent fa7104b commit ee8ad35
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ internal class GpsManager private constructor() : GpsProvider() {

@SuppressLint("MissingPermission")
private fun startLocationUpdates() {
stopLocationUpdates()
mCurrentLocation = null
mSettingsClient?.checkLocationSettings(mLocationSettingsRequest)?.addOnCompleteListener {
if (it.isSuccessful) {
if (mCurrentLocation == null && (getFragment() != null || getActivity() != null)) {
val frag = getFragment()
val act = getActivity()
if (mCurrentLocation == null && (act != null ||frag != null)) {
showDialog()
}
mFusedLocationClient?.requestLocationUpdates(
Expand Down

0 comments on commit ee8ad35

Please sign in to comment.