Android: How to pass a Bluetooth connection to another Activity?

后端 未结 4 1322
暗喜
暗喜 2021-01-03 07:31

I have my first Activity in which the BT connection is established. There is an option presented to the user and, based on their selection, a different Activity will load.

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-03 07:53

    I know it's an old question, but for the new people visiting this topic:

    I think Kibibyte's answer would also work, but otherwise there is the option to use a (Bound)Service. This would run even if the app closes

    Official Android Service documentation

提交回复
热议问题