BluetoothAdapter.getDefaultAdapter() throwing RuntimeException while not in Activity

前端 未结 5 425
天涯浪人
天涯浪人 2021-01-04 08:39

When I\'m trying to get default bluetooth adapter while i\'m NOT in Activity, but in TimerTask (created inside Service) by using:

B         


        
5条回答
  •  一整个雨季
    2021-01-04 09:26

    Hi Kocus there is no any method called getDefault() in BluetoothAdapter calss . It should be BluetoothAdapter.getDefaultAdapter();

    follow this link for more information.

提交回复
热议问题