Don't crash if device doesn't have Bluetooth
This commit is contained in:
parent
2ed57f6dec
commit
8334cd3926
1 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,8 @@ class FirstStartActivity extends AppCompatActivity with OnEditorActionListener w
|
|||
setContentView(R.layout.activity_first_start)
|
||||
setTitle(R.string.welcome)
|
||||
|
||||
username.setText(BluetoothAdapter.getDefaultAdapter.getName.trim)
|
||||
val name = Option(BluetoothAdapter.getDefaultAdapter).map(_.getName.trim).getOrElse("")
|
||||
username.setText(name)
|
||||
username.setOnEditorActionListener(this)
|
||||
done.setOnClickListener(this)
|
||||
|
||||
|
|
Reference in a new issue