implement notification channels, use system notification settings on android Oreo

This commit is contained in:
Conny Duck 2017-10-18 22:18:07 +02:00
commit 30312e0e55
7 changed files with 192 additions and 68 deletions

View file

@ -21,6 +21,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.Spanned;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@ -58,6 +59,9 @@ public class PullNotificationService extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
Log.d("PullNotifications", "pulling for notification");
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(
getApplicationContext());
boolean enabled = preferences.getBoolean("notificationsEnabled", true);