Ibeacon enter event with login activity

0
down vote
favorite
I am working with iBeacon and developing android app I almost finished the app my Beacon detects and generates enter an exit notifications events so far,

I followed this tutorial on estimote website to generate enter and exit notifications. https://developer.estimote.com/android/tutorial/part-1-setting-up/

but I would like my app only allow user to login if he in range of the beacon.

I’ve been searching for two days and since this is my first time working with beacons I could not figure out how to link the beacon to the loginActivity. Java there is no much useful resources unfortunately.

public class MyBeacon extends Application {

private BeaconManager beaconManager;

@Override
public void onCreate() {
    super.onCreate();

    beaconManager = new BeaconManager(getApplicationContext());


    /////////////////////////////////////////

    // add this below:
    beaconManager.setMonitoringListener(new BeaconManager.BeaconMonitoringListener() {
        @Override
        public void onEnteredRegion(BeaconRegion region, List<Beacon> beacons) {
            showNotification(
                    "Enter",
                    "welcome to the clinic!");
        }
        @Override
        public void onExitedRegion(BeaconRegion region) {
           showNotification(
                    "Exit",
                    "Goodbey!");
        }
    });

    ///////////////////////////////////////

    // add this below:
    beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
        @Override
        public void onServiceReady() {
            beaconManager.startMonitoring(new BeaconRegion(
                    "monitored region",
                    UUID.fromString("B9407F30-F5F8-466E-AFF9-25556B57FE6D"),
                    6632, 59107));
        }
    });
    //////////////////////////////////////////
}

public void showNotification(String title, String message) {
    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);
}

}

I would really really appreciate your help to complete my app :heart: