Back to project page CallerFlashlight.
The source code is released under:
GNU General Public License
If you think the Android project CallerFlashlight 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 com.spirosbond.callerflashlight; /* ww w . ja v a 2 s .c om*/ import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; import android.support.v4.app.NavUtils; import android.util.Log; import android.view.MenuItem; /** * Created by spiros on 8/24/13. */ public class CallPrefs extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = CallPrefs.class.getSimpleName(); private ListPreference lp; private CallerFlashlight callerFlashlight; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); callerFlashlight = (CallerFlashlight) this.getApplication(); addPreferencesFromResource(R.xml.call_prefs); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) getActionBar().setDisplayHomeAsUpEnabled(true); PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this); // lp = (ListPreference) findPreference("type_list"); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { if (callerFlashlight.LOG) Log.d(TAG, s + " changed!"); if (s.equals("volume_button_disable")) callerFlashlight.setVolumeButtonPref(sharedPreferences.getBoolean("volume_button_disable", false)); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar's Up/Home button case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } }