Only show Bluetooth dialog if Bluetooth is disabled.
This commit is contained in:
parent
7e71d231c9
commit
6a546d97a3
1 changed files with 5 additions and 4 deletions
|
@ -35,10 +35,11 @@ class MainActivity extends EnsiChatActivity {
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
val intent: Intent = new
|
||||
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE)
|
||||
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0)
|
||||
startActivityForResult(intent, RequestSetDiscoverable)
|
||||
if (BluetoothAdapter.getDefaultAdapter.isEnabled) {
|
||||
val intent: Intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE)
|
||||
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0)
|
||||
startActivityForResult(intent, RequestSetDiscoverable)
|
||||
}
|
||||
|
||||
val fm = getFragmentManager
|
||||
if (savedInstanceState != null) {
|
||||
|
|
Reference in a new issue