public class GoogleLocationClient extends BaseGoogleLocationClient implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener
GoogleApiClient
-based Google Play Services Location API.CAUSE_NETWORK_LOST, CAUSE_SERVICE_DISCONNECTED
Constructor and Description |
---|
GoogleLocationClient()
Initialises a newly created
GoogleLocationClient object. |
Modifier and Type | Method and Description |
---|---|
protected void |
buildClient(Activity activity)
Please refer to the base method description.
|
protected void |
clearResolvingError()
Clears resolving error.
|
protected void |
connect()
Connects the client.
|
GoogleApiClient |
getClient()
Returns the Google Play Services Location API client.
|
protected void |
getFromBundle(Bundle savedInstanceState)
Please refer to the base method description.
|
boolean |
onActivityResult(Activity activity,
akha.yakhont.Core.RequestCodes requestCode,
int resultCode,
Intent data)
Please refer to the base method description.
|
void |
onConnected(Bundle connectionHint)
Please refer to the base method description.
|
void |
onConnectionFailed(ConnectionResult result)
Please refer to the base method description.
|
void |
onConnectionSuspended(int cause)
Please refer to the base method description.
|
void |
onCreate(Activity activity,
Bundle savedInstanceState)
Please refer to the base method description.
|
void |
onPause(Activity activity)
Please refer to the base method description.
|
void |
onResume(Activity activity)
Please refer to the base method description.
|
void |
onSaveInstanceState(Activity activity,
Bundle savedInstanceState)
Please refer to the base method description.
|
void |
onStart(Activity activity)
Please refer to the base method description.
|
void |
onStop(Activity activity)
Please refer to the base method description.
|
protected void |
requestLocationUpdates(Activity activity,
LocationRequest locationRequest)
Please refer to the base method description.
|
LocationCallbacks.LocationClient |
showSystemErrorDialog(boolean systemErrorDialog)
Sets the "show system error dialog" flag.
|
protected void |
stopLocationUpdates(Activity activity)
Please refer to the base method description.
|
createNewLocationRequest, getCurrentLocation, getLastUpdateTime, onDestroy, onLocationChanged, setLocation, setLocationCallbacks, setLocationUpdatesParameters, setLocationUpdatesParameters, setLocationUpdatesParameters, setUniqueUpdates, startLocationUpdates
public GoogleLocationClient()
GoogleLocationClient
object.public GoogleApiClient getClient()
GoogleApiClient
public LocationCallbacks.LocationClient showSystemErrorDialog(boolean systemErrorDialog)
true
.systemErrorDialog
- true
to display system error dialog, false
otherwiseLocationClient
objectprotected void clearResolvingError()
protected void connect()
public void onSaveInstanceState(Activity activity, Bundle savedInstanceState)
onSaveInstanceState
in interface LocationCallbacks.LocationClient
onSaveInstanceState
in class BaseGoogleLocationClient
activity
- The ActivitysavedInstanceState
- The last saved instance state of the Activity, or nullprotected void getFromBundle(Bundle savedInstanceState)
getFromBundle
in class BaseGoogleLocationClient
savedInstanceState
- The activity state saved in the Bundle
public void onCreate(Activity activity, Bundle savedInstanceState)
onCreate
in interface LocationCallbacks.LocationClient
onCreate
in class BaseGoogleLocationClient
activity
- The ActivitysavedInstanceState
- The last saved instance state of the Activity, or nullpublic void onStart(Activity activity)
onStart
in interface LocationCallbacks.LocationClient
onStart
in class BaseGoogleLocationClient
activity
- The Activitypublic void onResume(Activity activity)
onResume
in interface LocationCallbacks.LocationClient
onResume
in class BaseGoogleLocationClient
activity
- The Activitypublic void onPause(Activity activity)
onPause
in interface LocationCallbacks.LocationClient
onPause
in class BaseGoogleLocationClient
activity
- The Activitypublic void onStop(Activity activity)
onStop
in interface LocationCallbacks.LocationClient
onStop
in class BaseGoogleLocationClient
activity
- The Activityprotected void requestLocationUpdates(@NonNull Activity activity, @NonNull LocationRequest locationRequest)
requestLocationUpdates
in class BaseGoogleLocationClient
activity
- The activitylocationRequest
- The LocationRequest
protected void stopLocationUpdates(Activity activity)
stopLocationUpdates
in class BaseGoogleLocationClient
activity
- The activityprotected void buildClient(@NonNull Activity activity)
buildClient
in class BaseGoogleLocationClient
activity
- The activitypublic void onConnected(Bundle connectionHint)
onConnected
in interface GoogleApiClient.ConnectionCallbacks
public void onConnectionSuspended(int cause)
onConnectionSuspended
in interface GoogleApiClient.ConnectionCallbacks
public void onConnectionFailed(@NonNull ConnectionResult result)
onConnectionFailed
in interface GoogleApiClient.OnConnectionFailedListener
public boolean onActivityResult(Activity activity, akha.yakhont.Core.RequestCodes requestCode, int resultCode, Intent data)
onActivityResult
in interface LocationCallbacks.LocationClient
activity
- The ActivityrequestCode
- The request code originally supplied to Activity.startActivityForResult(Intent, int)
,
allowing you to identify who this result came fromresultCode
- The integer result code returned by the child activity through its Activity.setResult(int)
data
- The Intent, which can return result data to the callertrue
if requestCode
was handled, false
otherwise
Copyright © 2015-2017 akha, a.k.a. Alexander Kharitonov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.