Back to project page track-to-speech.
The source code is released under:
MIT License
If you think the Android project track-to-speech listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.jordanrobinson.tracktospeech; /*from ww w . j a v a 2 s.c o m*/ import android.app.NotificationManager; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; public class PrefsActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener { @SuppressWarnings("deprecation") //TODO: update to something that works this time @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (getString(R.string.pref_notify_key).equals(key)) { if (MainActivity.showNotifier) { NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.cancel(0); MainActivity.showNotifier = false; } else { MainActivity.showNotifier = true; } } else if (getString(R.string.pref_pattern_key).equals(key)) { //TODO: pattern logic } } }