mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 17:27:24 +01:00
40 lines
1.5 KiB
Java
40 lines
1.5 KiB
Java
package nodomain.freeyourgadget.gadgetbridge;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.preference.Preference;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.activities.AbstractSettingsActivity;
|
|
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandPreferencesActivity;
|
|
|
|
public class SettingsActivity extends AbstractSettingsActivity {
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
addPreferencesFromResource(R.xml.preferences);
|
|
}
|
|
|
|
@Override
|
|
protected void onPostCreate(Bundle savedInstanceState) {
|
|
super.onPostCreate(savedInstanceState);
|
|
|
|
Preference pref = 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;
|
|
}
|
|
});
|
|
pref = findPreference("pref_key_miband");
|
|
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
|
public boolean onPreferenceClick(Preference preference) {
|
|
Intent enableIntent = new Intent(SettingsActivity.this, MiBandPreferencesActivity.class);
|
|
startActivity(enableIntent);
|
|
return true;
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|