Back to project page SurgePriceWidget.
The source code is released under:
MIT License
If you think the Android project SurgePriceWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.mattlogan.surgepricewidget.location; //w ww . j av a 2 s .c o m import android.content.Context; import android.os.Bundle; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.location.LocationClient; import me.mattlogan.surgepricewidget.location.event.LocationClientConnectedEvent; public class CurrentLocationClient { static LocationClient locationClient; public static LocationClient getClient(Context context) { if (locationClient == null) { locationClient = new LocationClient( context.getApplicationContext(), callbacks, failureListener); } return locationClient; } static GooglePlayServicesClient.ConnectionCallbacks callbacks = new GooglePlayServicesClient.ConnectionCallbacks() { @Override public void onConnected(Bundle bundle) { LocationBus.getInstance().post(new LocationClientConnectedEvent()); } @Override public void onDisconnected() { } }; static GooglePlayServicesClient.OnConnectionFailedListener failureListener = new GooglePlayServicesClient.OnConnectionFailedListener() { @Override public void onConnectionFailed(ConnectionResult connectionResult) { } }; }