简体   繁体   中英

What is the alternative of LocationClient?

I have no problem in all the code for background GPS, but I only have problem in the part of LocationClient (it can't be resolved)

protected void onHandleIntent(Intent intent) {
    Location location = intent.getParcelableExtra(LocationClient.KEY_LOCATION_CHANGED);
    if (location != null) {
        Log.i(TAG, "onHandleIntent " + location.getLatitude() + "," + location.getLongitude());
        NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        Builder noti = new NotificationCompat.Builder(this);
        noti.setContentTitle("Sks Location Client");
        noti.setContentText(location.getLatitude() + "," + location.getLongitude());
        // noti.setSmallIcon(R.drawable.ic_la);

        notificationManager.notify(1234, noti.build());

    }

Here is the part that cannot be resolved :

Location location = intent.getParcelableExtra(LocationClient.KEY_LOCATION_CHANGED);

不推荐使用LocationClient,您必须使用GoogleApiClient。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM