diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/NotificationListener.java
index 25613927..f1d936ce 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/NotificationListener.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/NotificationListener.java
@@ -31,9 +31,6 @@ public class NotificationListener extends NotificationListenerService {
Log.i(TAG, source);
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
- if (!sharedPrefs.getBoolean("notifications_generic", true)) {
- return;
- }
if (!sharedPrefs.getBoolean("notifications_generic_whenscreenon", false)) {
PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE);
if (powermanager.isScreenOn()) {
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/SettingsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/SettingsActivity.java
index d4f194c2..67c0df9b 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/SettingsActivity.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/SettingsActivity.java
@@ -2,6 +2,7 @@ package nodomain.freeyourgadget.gadgetbridge;
import android.annotation.TargetApi;
import android.content.Context;
+import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
@@ -65,6 +66,14 @@ public class SettingsActivity extends PreferenceActivity {
getPreferenceScreen().addPreference(fakeHeader);
addPreferencesFromResource(R.xml.pref_notification);
+ Preference pref = (Preference) findPreference("notifications_generic");
+ pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ public boolean onPreferenceClick(Preference preference) {
+ Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
+ startActivity(enableIntent);
+ return true;
+ }
+ });
// Bind the summaries of EditText/List/Dialog/Ringtone preferences to
// their values. When their values change, their summaries are updated
@@ -135,7 +144,6 @@ public class SettingsActivity extends PreferenceActivity {
? listPreference.getEntries()[index]
: null);
-
} else {
// For all other preferences, set the summary to the value's
// simple string representation.
@@ -181,8 +189,8 @@ public class SettingsActivity extends PreferenceActivity {
// to their values. When their values change, their summaries are
// updated to reflect the new value, per the Android Design
// guidelines.
- bindPreferenceSummaryToValue(findPreference("example_text"));
- bindPreferenceSummaryToValue(findPreference("example_list"));
+ //bindPreferenceSummaryToValue(findPreference("example_text"));
+ //bindPreferenceSummaryToValue(findPreference("example_list"));
}
}
@@ -197,11 +205,20 @@ public class SettingsActivity extends PreferenceActivity {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_notification);
+ Preference pref = (Preference) findPreference("notifications_generic");
+ pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ public boolean onPreferenceClick(Preference preference) {
+ Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
+ startActivity(enableIntent);
+ return true;
+ }
+ });
+
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
// to their values. When their values change, their summaries are
// updated to reflect the new value, per the Android Design
// guidelines.
- bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
+ //bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
}
}
}
diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml
index 7a6dd2ca..5bee5ea6 100644
--- a/app/src/main/res/xml/pref_notification.xml
+++ b/app/src/main/res/xml/pref_notification.xml
@@ -3,43 +3,41 @@
+ android:title="@string/pref_title_notifications_sms" />
+ android:title="@string/pref_title_whenscreenon" />
+ android:title="@string/pref_title_notifications_k9mail" />
+ android:title="@string/pref_title_whenscreenon" />
-
+ android:title="@string/pref_title_notifications_generic" />
+ android:title="@string/pref_title_whenscreenon" />