Android Open Source - FlangeAssist Preference Menu






From Project

Back to project page FlangeAssist.

License

The source code is released under:

MIT License

If you think the Android project FlangeAssist listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.atasoft.flangeassist;
/*www .j  a v a2 s  . c  om*/
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;

public class PreferenceMenu extends PreferenceActivity {
    @Override
  public void onCreate(Bundle savedInstanceState) {    
    super.onCreate(savedInstanceState);       
    getFragmentManager().beginTransaction().replace(android.R.id.content, new PrefsFragment()).commit();
    }
    
    public static class PrefsFragment extends PreferenceFragment {
       
        @SuppressLint("NewApi")
    @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            
            if(android.os.Build.VERSION.SDK_INT >= 14) {
              addPreferencesFromResource(R.xml.preferences);
              Preference resetPref = findPreference("reset_switch");

              resetPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                @Override
                   public boolean onPreferenceClick(Preference arg0) {
                  SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
                    Editor editor = prefs.edit();
                    editor.clear();
                    editor.commit();
                  getActivity().finish();
                       return true;
                  }

              });
            } else {
              addPreferencesFromResource(R.xml.prefnoclick);
            }
            
        }
    }  

}




Java Source Code List

com.atasoft.adapters.ExListAd.java
com.atasoft.adapters.ExpandableGroup.java
com.atasoft.adapters.TabsPagerAdapter.java
com.atasoft.flangeassist.FragFramer.java
com.atasoft.flangeassist.MainActivity.java
com.atasoft.flangeassist.PreferenceMenu.java
com.atasoft.flangeassist.ToolsActivity.java
com.atasoft.flangeassist.fragments.AboutFragment.java
com.atasoft.flangeassist.fragments.CashCounter.java
com.atasoft.flangeassist.fragments.FlangeFragment.java
com.atasoft.flangeassist.fragments.HallFragment.java
com.atasoft.flangeassist.fragments.NozzleCalc.java
com.atasoft.flangeassist.fragments.PaychequeFragment.java
com.atasoft.flangeassist.fragments.RigTrig.java
com.atasoft.flangeassist.fragments.ShapeCalcFrag.java
com.atasoft.flangeassist.fragments.TorqueFragment.java
com.atasoft.flangeassist.fragments.UnitConFragment.java
com.atasoft.flangeassist.fragments.WageCPIEstimate.java
com.atasoft.flangeassist.fragments.WeldingFrag.java
com.atasoft.helpers.AtaMathUtils.java
com.atasoft.helpers.AtaTimePicker.java
com.atasoft.helpers.ConvDataHold.java
com.atasoft.helpers.JsonPuller.java
com.atasoft.helpers.ShapeCalcHold.java
com.atasoft.helpers.TaxManager.java