kai-morich / SimpleUsbTerminal

Android terminal app for devices with a serial / UART interface connected with a USB-to-serial-converter
MIT License
529 stars 195 forks source link

retain connection when changing fragment or activity #46

Closed kmd2410 closed 1 year ago

kmd2410 commented 2 years ago

I succeeded in connecting and reading data with your wonderful code. I want to switch pages while staying connected after being connected. Can you advise me how to do it? thank taecher..

kmd2410 commented 2 years ago

I want to change the screen while maintaining the serial connection.

kai-morich commented 2 years ago

please have a look at the service member of the terminal fragment class. By using setRetainInstance this member stays valid over rotation or sending the app to background. You could also store it at the Activity or Application object.