Skip to content

Commit

Permalink
Prevent crash due to null beaconManager by getting instance before st…
Browse files Browse the repository at this point in the history
…arting power save callbacks
  • Loading branch information
davidgyoung committed Mar 2, 2017
1 parent 3f44542 commit d971e20
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public BackgroundPowerSaver(Context context) {
LogManager.w(TAG, "BackgroundPowerSaver requires API 18 or higher.");
return;
}
((Application)context.getApplicationContext()).registerActivityLifecycleCallbacks(this);
beaconManager = BeaconManager.getInstanceForApplication(context);
((Application)context.getApplicationContext()).registerActivityLifecycleCallbacks(this);
}

@Override
Expand Down

0 comments on commit d971e20

Please sign in to comment.