Back to project page GPS2SMS.
The source code is released under:
GNU General Public License
If you think the Android project GPS2SMS 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 ru.perm.trubnikov.gps2sms; //w w w . j a v a 2 s . co m import android.annotation.TargetApi; import android.app.Activity; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceGroup; import android.preference.PreferenceManager; import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; @TargetApi(11) public class PreferencesActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { // ??????????? ???? ?????? ???? ?? super.onCreate ? setContentView SharedPreferences sharedPrefs = PreferenceManager .getDefaultSharedPreferences(this); setTheme(sharedPrefs.getString("prefAppTheme", "1").equalsIgnoreCase( "1") ? R.style.AppTheme_Dark : R.style.AppTheme_Light); setTitle(R.string.menu_item_settings); // otherwise it's not changed super.onCreate(savedInstanceState); setContentView(R.layout.pref_with_actionbar); getFragmentManager().beginTransaction().replace(R.id.preference_container, new PrefsFragment()).commit(); ShowBackButton(); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; default: return super.onOptionsItemSelected(item); } } public void ShowBackButton() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // call something for API Level 11+ getSupportActionBar().setDisplayHomeAsUpEnabled(true); } } }