Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7677753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:29:39+00:00 2026-05-31T17:29:39+00:00

as someone’s who’s just starting to get into Android/Java programming, I’ve read the docs

  • 0

as someone’s who’s just starting to get into Android/Java programming, I’ve read the docs at https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#ACTION_DISCOVERY_FINISHED and i’m trying to figure out what whether I would only get ACTION_DISCOVERY_FINISHED when the bluetooth 12 second scan is completed, and it comes back WITH NO DEVICES, or, does it return ACTION_DISCOVERY_FINISHED every time it scans, and it has some sort of return code that I don’t see in the docs?

The scenario is: I’m building a broadcast receiver that would listen in to BT, and if it is turned on, starts discovery and ends discovery AND finds nothing, I wanna turn off BT.

If it does return codes, I would love a link/the codes themselves.

Thanks for reading and helping out!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:29:40+00:00Added an answer on May 31, 2026 at 5:29 pm

    The ACTION_DISCOVERY_FINISHED tells you that discovery has finished, no more or less.

    There is a separate Intent, ACTION_FOUND, that is sent when a device is discovered.

    To accomplish your desired functionality, you want to check in your broadcast receiver

    intent.getAction().equals(BluetoothDevice.ACTION_FOUND)
    

    If an intent is received such that this evaluates to true, then you have discovered a BluetoothDevice. If you want to do processing on that device, you can access it via

    BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
    

    Edit: If you only want to know that no devices were found, you can just set a flag in the ACTION_FOUND-handling code. If the flag isn’t set, then no devices were found.

    EDIT2: The process of Bluetooth Device discovery will send out this sequence of intents:

    1 ACTION_DISCOVERY_STARTED
    0 or more ACTION_FOUND
    1 ACTION_DISCOVERY_ENDED

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Someone just sent me a decompile of a program into C. It was a
Someone at work just asked for the reasoning behind having to wrap a wait
Someone decided to stuff a bunch of times together into a single column, so
Someone just dumped a perl script on me and now it's my problem. I
Someone told me to look into vanilla web interface. I have Googled it, but
Someone suggested this for me to use as an animation: <Window x:Class=WpfApplication.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Someone else with the same problem still didn't get a decent answer/fix for my
Someone told me about a C++ style difference in their team. I have my
Someone please correct me if I'm wrong, but parsing a yyyy/MM/dd (or other specific
Someone asked me how familiar I am with VC++ and how familiar I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.