Android onStart executes faster than a broadcast
===

So I am calling a native device selector `android.bluetooth.devicepicker.action.LAUNCH` with will broadcast `android.bluetooth.devicepicker.action.DEVICE_SELECTED` action to a extended Broadcast reciver `DeviceReceiver.java`. The receiver receives the selected device details and sets a static public boolean `isDeviceSelected = true`

As the device selector closes the activity view goes live again and triggers `onStart();`

There I check `if (DeviceReceiver.isDeviceSelected == true) { connectToDevice(); } `

So the issue is that sometimes (5%) the `onStart` executes before DeviceReceiver sets `isDeviceSelected=true`.

How do I make onStart to execute only when DeviceReceiver execution is done?