Revert "Only show Bluetooth dialog if Bluetooth is disabled."

This reverts commit 6a546d97a3.

Looks like discovery only works if we explicitly request Bluetooth.
This commit is contained in:
Felix Ableitner 2015-02-27 12:40:27 +01:00
parent 8688f973e8
commit 879c80e11c

View file

@ -35,11 +35,10 @@ class MainActivity extends EnsiChatActivity {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
if (BluetoothAdapter.getDefaultAdapter.isEnabled) { val intent: Intent = new
val intent: Intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE) Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE)
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0) intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0)
startActivityForResult(intent, RequestSetDiscoverable) startActivityForResult(intent, RequestSetDiscoverable)
}
val fm = getFragmentManager val fm = getFragmentManager
if (savedInstanceState != null) { if (savedInstanceState != null) {