I have an application that uses a USB to serial converter. It consists of a main form and two services. The main form fires one of the two services based on two buttons. I put the following code in my manifest so that whenever the USB to serial converted is attached, the application is started.
This works perfectly. I plug in the USB converter and the application starts with the main form on the screen.
However, I have a problem when I reboot the device (An Android TV box). When the device boots with the USB to Serial converter attached, it auto starts both services but not the main form. This is troublesome because The main form is really what needs to be started and then it can start whatever services based on the user interaction (Or saved settings which will fire the service of choice).
What should I be tweaking so that when the device reboots, it starts the main form but not the two services?
Kurt
B4X:
AddActivityText(main, <intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />)
This works perfectly. I plug in the USB converter and the application starts with the main form on the screen.
However, I have a problem when I reboot the device (An Android TV box). When the device boots with the USB to Serial converter attached, it auto starts both services but not the main form. This is troublesome because The main form is really what needs to be started and then it can start whatever services based on the user interaction (Or saved settings which will fire the service of choice).
What should I be tweaking so that when the device reboots, it starts the main form but not the two services?
Kurt