Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Fix sample app crash (#191)
Browse files Browse the repository at this point in the history
* rm updates in pending intent example

* checkstyle
  • Loading branch information
sarahsnow1 authored May 9, 2017
1 parent b201283 commit 836bdbf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
public class PendingIntentActivity extends LostApiClientActivity {

PendingIntent pendingIntent;

@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pending_intent);
Expand Down Expand Up @@ -47,6 +49,7 @@ private void setupDisconnectBtn() {
Button disconnect = (Button) findViewById(R.id.disconnect);
disconnect.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
LocationServices.FusedLocationApi.removeLocationUpdates(client, pendingIntent);
disconnect();
}
});
Expand All @@ -58,7 +61,7 @@ private void requestLocationUpdates() {
request.setInterval(100);

Intent intent = new Intent(PendingIntentService.ACTION);
PendingIntent pendingIntent = PendingIntent.getService(PendingIntentActivity.this, 1,
pendingIntent = PendingIntent.getService(PendingIntentActivity.this, 1,
intent, 0);
LocationServices.FusedLocationApi.requestLocationUpdates(client, request, pendingIntent);

Expand Down

0 comments on commit 836bdbf

Please sign in to comment.