Q:

Use BroadcastReceiver that asks a user if they wish to open app onReceive

I am trying to create an app that communicates with USB flash drive. I would like to have the user prompted and asked if they wish to open the app once the intent "android.hardware.usb.action.USB_DEVICE_ATTACHED" is received. 
Currently, I have the onRecieve() set up so that it launches the main activity
 @Override
public void onReceive(Context context, Intent intent) {

    Intent startIntent = context
            .getPackageManager()
            .getLaunchIntentForPackage(context.getPackageName());

    startIntent.setFlags(
            Intent.FLAG_ACTIVITY_REORDER_TO_FRONT |
                    Intent.FLAG_ACTIVITY_NEW_TASK |
                    Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
    );
    context.startActivity(startIntent);
}

I would like to have the user prompted for permission first, a good example of what I would like to achieve is ES File Explorer Like this

A:

I would like to have the user prompted and asked if they wish to open the app once the intent "android.hardware.usb.action.USB_DEVICE_ATTACHED" is received.

The screen you want to show has to from your app so in fact is has already started, even if the user perceives it differently.
What you can do is start an activity when this broadcast is received (you need to be in activity context to be able to show stuff on the screen). Make the activity's background transparent and have it show a dialog on top that handles the user's input. From there you either start the next activity, or not.

