I am getting this error can anybody help me out please
public class MainActivity extends AppCompatActivity {
Context context;
BeaconManager beaconManager = new BeaconManager(getApplicationContext());
private boolean notificationAlreadyShown = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// EstimoteSDK.initialize(getApplicationContext(), "<#App ID#>", "<#App Token#>");
beaconManager.setLocationListener(new BeaconManager.LocationListener() {
@Override
public void onLocationsFound(List<EstimoteLocation> beacons) {
Log.d("LocationListener", "Nearby beacons: " + beacons);
}
});
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override public void onServiceReady() {
beaconManager.startLocationDiscovery();
}
});
}
@Override
protected void onResume() {
super.onResume();
SystemRequirementsChecker.checkWithDefaultDialogs(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
beaconManager.disconnect();
}
public void showNotification(String title, String message) {
if (notificationAlreadyShown) { return; }
Intent notifyIntent = new Intent(this, MainActivity.class);
notifyIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivities(this, 0,
new Intent[] { notifyIntent }, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new Notification.Builder(this)
.setSmallIcon(android.R.drawable.ic_dialog_info)
.setContentTitle(title)
.setContentText(message)
.setAutoCancel(true)
.setContentIntent(pendingIntent)
.build();
notification.defaults |= Notification.DEFAULT_SOUND;
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, notification);
notificationAlreadyShown = true;
}
public void onLocationsFound(List<EstimoteLocation> beacons) {
Log.d("LocationListener", "Nearby beacons: " + beacons);
// replace with an identifier of your own beacon
// you can find the identifier on the Estimote Cloud "Beacons" dashboard
// or in the Estimote app from the Google Play Store
String beaconId = "B9407F30-F5F8-466E-AFF9-25556B57FE6D";
for (EstimoteLocation beacon : beacons) {
if (beacon.id.toString().equals(beaconId)
&& RegionUtils.computeProximity(beacon) == Proximity.NEAR) {
showNotification("Hello world", "Looks like you're near a beacon.");
}
}
}
}