Search code examples
androidandroid-intenttimeoutbroadcastreceiver

Set timeout for receiving a broadcast


I want to play some sounds via bluetooth and therefore I'm using the audioManager.startBluetoothSco() method. This will (eventually) give out a Broadcast telling me, that everything is ready. However, if this is not the case, I need a timeout. How do I do that? With SystemClock.sleep? Can you help me with that?


Solution

  • You can use a timer. Here is a tutorial for using it.