Android Question How do I force bluetooth to enable and start discovery via click?

Discussion in 'Android Questions' started by Roy Raymundo, Mar 8, 2015.

  1. Roy Raymundo

    Roy Raymundo Member Licensed User

    My activity enables bluetooth every time it loads and search for device a whenever I click a menu in the Menu button. But when I disable the bluetooth via turning it off manually in my Android phone, and then click the "Connect via bluetooth" again in my home menu, it will just display "Error starting discovery process". How will I force it to enable bluetooth again via click of that option in home menu, and to start discovering devices again. Does it has to do with :
    Admin_StateChanged(admin.STATE_ON,0) ?
  2. Erel

    Erel Administrator Staff Member Licensed User

    You need to first enable it and then wait for the StateChanged event.

    Check B4A-Bridge source code for an example.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice