Skip to content

Commit

Permalink
handle dead activity
Browse files Browse the repository at this point in the history
  • Loading branch information
r-cohen committed Apr 16, 2018
1 parent d6a0351 commit 86fd13f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 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.6'
compile 'com.github.phearme:bt-scan-selector:1.1.7'
}
```
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 19
versionName "1.1.6"
versionCode 20
versionName "1.1.7"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,16 @@ private void updateIconResId() {
iconResourceId = R.drawable.network_high;
return;
}
if (rssi <= -50 && rssi > -70) {
if (rssi > -70) {
iconResourceId = R.drawable.network_medium;
return;
}
if (rssi <= -70 && rssi > -90) {
if (rssi > -90) {
iconResourceId = R.drawable.network_low;
return;
}
if (rssi <= -90) {
iconResourceId = R.drawable.network_no_signal;
return;
}
iconResourceId = R.drawable.network_null;
iconResourceId = R.drawable.network_no_signal;
//iconResourceId = R.drawable.network_null;
}

public int getIconResourceId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ public void setTitle(String title) {

@Override
public void onDestroy() {
if (mAdapter != null) {
if (mAdapter != null && getActivity() != null) {
mAdapter.terminate(getActivity());
}
super.onDestroy();
}

private void bindRecyclerView() {
if (getActivity() == null) {
return;
}
if (getActivity().checkCallingOrSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION_PERMISSION);
return;
Expand Down

0 comments on commit 86fd13f

Please sign in to comment.