altosdroid: Switch to NotificationCompat
authorKeith Packard <keithp@keithp.com>
Fri, 7 Feb 2020 01:15:14 +0000 (17:15 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 7 Feb 2020 01:15:14 +0000 (17:15 -0800)
Instead of Notification, which doesn't appear to work on older android
releases.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/app/build.gradle.in
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java

index cc29d86ca7b0a5d64b2a2a7779ad8882ded1336e..5dbd30ee81b5606178f68dbbd3307936b2a02908 100644 (file)
@@ -41,7 +41,7 @@ android {
 dependencies {
     implementation 'androidx.appcompat:appcompat:1.0.0'
     implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+    implementation 'androidx.core:core:1.2.0'
     implementation 'com.google.android.gms:play-services-maps:17.0.0'
     implementation fileTree(dir: 'libs', include: ['*.jar'])
 }
-
index 5dba24ba071897316143d6a2ab21cf0addf10fef..d4f72b3f7421851d8d4051b4f6a15d590d360af9 100644 (file)
@@ -31,6 +31,7 @@ import android.content.Intent;
 import android.content.Context;
 import android.os.*;
 import android.widget.Toast;
+import androidx.core.app.NotificationCompat;
 
 import org.altusmetrum.altoslib_13.*;
 
@@ -657,7 +658,7 @@ public class TelemetryService extends Service implements AltosIdleMonitorListene
                                                : "";
 
                // Create notification to be displayed while the service runs
-               Notification notification = new Notification.Builder(this, channelId)
+               Notification notification = new NotificationCompat.Builder(this, channelId)
                                .setContentTitle(getText(R.string.telemetry_service_label))
                                .setContentText(getText(R.string.telemetry_service_started))
                                .setContentIntent(contentIntent)