diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 3b6dec1..284218d 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -25,6 +25,7 @@ diff --git a/android/src/main/java/com/reactlibrary/ItoBluetoothModule.java b/android/src/main/java/com/reactlibrary/ItoBluetoothModule.java index e1d3565..b9ae62f 100644 --- a/android/src/main/java/com/reactlibrary/ItoBluetoothModule.java +++ b/android/src/main/java/com/reactlibrary/ItoBluetoothModule.java @@ -3,6 +3,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import androidx.core.content.ContextCompat; import android.content.ServiceConnection; import android.os.IBinder; import android.os.RemoteException; @@ -60,7 +61,7 @@ public ItoBluetoothModule(ReactApplicationContext reactContext) { Log.d(LOG_TAG, "Creating ItoBluetoothModule"); this.reactContext = reactContext; Intent intent = new Intent(reactContext, TracingService.class); - reactContext.startService(intent); + ContextCompat.startForegroundService(reactContext, intent); bindService(); }