Skip to content

Commit 0a1ddf8

Browse files
committed
App crash fix
1 parent 6c1f4fd commit 0a1ddf8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
minSdk 21
1111
targetSdk 31
1212
multiDexEnabled true
13-
versionCode 10
14-
versionName "2.2.0" // bugsnag removed
13+
versionCode 11
14+
versionName "2.2.1"
1515

1616

1717
}

app/src/main/java/github/umer0586/service/SensorService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public int onStartCommand(Intent intent, int flags, int startId)
108108
{
109109

110110
Log.d(TAG, "onStartCommand()");
111+
handleAndroid8andAbove();
111112

112113

113114
boolean localHostPref = sharedPreferences.getBoolean(getString(R.string.pref_key_localhost),false);
@@ -129,7 +130,7 @@ public int onStartCommand(Intent intent, int flags, int startId)
129130
if(serverErrorListener != null)
130131
serverErrorListener.onError(new UnknownHostException());
131132

132-
handleAndroid8andAbove();
133+
133134
stopForeground(true);
134135

135136
return START_NOT_STICKY;
@@ -242,7 +243,7 @@ private void handleAndroid8andAbove()
242243
.setContentText("").build();
243244

244245
startForeground(TEMP_NOTIFICATION_ID, tempNotification);
245-
//stopForeground(true);
246+
stopForeground(true);
246247

247248

248249
}

0 commit comments

Comments
 (0)