public class DeviceSelectorDialogManager extends Object implements AutoCloseable
DeviceSelectorDialog.| Constructor and Description |
|---|
DeviceSelectorDialogManager(Context context,
FragmentManager fragmentManager,
String tag)
Constructs a new
DeviceSelectorDialogManager and connects to a DeviceSelectorDialog. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases held resources.
|
void |
onDeviceConnectionStateChanged()
Lets the
DeviceSelectorDialog know that a USB device has been connected or disconnected. |
void |
onUsbPermissionIntent(Intent intent)
Forwards results from
UsbManager.requestPermission(UsbDevice, PendingIntent)
to the DeviceSelectorDialog for further processing. |
void |
show()
Shows the
DeviceSelectorDialog. |
public DeviceSelectorDialogManager(Context context, FragmentManager fragmentManager, String tag)
DeviceSelectorDialogManager and connects to a DeviceSelectorDialog.context - the Context to usefragmentManager - the FragmentManager to usetag - the tag to use when registering the DeviceSelectorDialog with fragmentManagerpublic void close()
DeviceSelectorDialogManager's destruction.close in interface AutoCloseablepublic void onUsbPermissionIntent(Intent intent)
UsbManager.requestPermission(UsbDevice, PendingIntent)
to the DeviceSelectorDialog for further processing.intent - the Intent received in the BroadcastReceiverpublic void onDeviceConnectionStateChanged()
DeviceSelectorDialog know that a USB device has been connected or disconnected.
Should be called when handling UsbManager.ACTION_USB_DEVICE_ATTACHED
and UsbManager.ACTION_USB_DEVICE_DETACHED messages.public void show()
DeviceSelectorDialog.