title: Bluetooth discovery without prompt in Android
body: <p>I am able to turn on/off Bluetooth without any prompt using the following code. It requires <code>BLUETOOTH</code> and <code>BLUETOOTH_ADMIN</code> permissions.</p>
  <pre><code>boolean isEnabled = bluetoothAdapter.isEnabled();
  if (enable &amp;&amp; !isEnabled) {
      return bluetoothAdapter.enable();
  } else if (!enable &amp;&amp; isEnabled) {
      return bluetoothAdapter.disable();
  }
  </code></pre>
  <p>But didn't find any way to set Bluetooth discoverable without user prompt. It's wired to prompt every time to user. There is no &quot;don't ask me again&quot; feature I afraid. Is there any good way to make Bluetooth device discoverable? I don't care about the duration. Also my device is not rooted.</p>
  <h1>More Info</h1>
  <p>I found source code of <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2_r1/android/bluetooth/BluetoothAdapter.java#BluetoothAdapter" rel="nofollow noreferrer">BluetoothAdapter.java</a> and it has a public method named <code>setDiscoverableDuration</code>. But why I can't access it? Why some public methods are hidden in Api documentations? How did they even do that? all methods are public.</p>