Skip to content

Commit

Permalink
handle devices with no default bt device
Browse files Browse the repository at this point in the history
  • Loading branch information
r-cohen committed Apr 2, 2018
1 parent 33f0922 commit d6a0351
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Add the dependency to the **Module** gradle file:
```gradle
dependencies {
...
compile 'com.github.phearme:bt-scan-selector:1.1.5'
compile 'com.github.phearme:bt-scan-selector:1.1.6'
}
```
Enable databinding in the **Module** grade file:
Expand Down
4 changes: 2 additions & 2 deletions btscanselector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 18
versionName "1.1.5"
versionCode 19
versionName "1.1.6"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
progressBar = view.findViewById(R.id.progressBar);

BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
if (!btAdapter.isEnabled()) {
if (btAdapter != null && !btAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
} else {
Expand Down

0 comments on commit d6a0351

Please sign in to comment.