Back to project page Tacere.
The source code is released under:
MIT License
If you think the Android project Tacere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (c) 2014 Jonathan Nelson/* ww w. j a va 2 s . com*/ * Released under the BSD license. For details see the COPYING file. */ package org.ciasaboark.tacere.activity; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import org.ciasaboark.tacere.R; public class BetaSettingsActivity extends Activity { private static final String PREFS_FILE = "beta_settings"; private static final String BETA_ENABLED = "beta_enabled"; public static void enableBetaSettings(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(PREFS_FILE, Context.MODE_PRIVATE); prefs.edit().putBoolean(BETA_ENABLED, true); } public static boolean isBetaSettingsEnabled(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(PREFS_FILE, Context.MODE_PRIVATE); return prefs.getBoolean(BETA_ENABLED, false); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_beta_settings); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.beta_settings, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }