Android Open Source - CamOMatic Preferences






From Project

Back to project page CamOMatic.

License

The source code is released under:

GNU General Public License

If you think the Android project CamOMatic 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 edu.uic.cs440;
/*w  ww.j a  v  a 2s.  com*/
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.widget.Toast;

public class Preferences extends PreferenceActivity{
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    
    // Reset Config State Clicked
    Preference configState = (Preference) findPreference("camomatic_config_state");
    configState.setOnPreferenceClickListener(new OnPreferenceClickListener() {
      
      public boolean onPreferenceClick(Preference preference) {
        Toast.makeText(getBaseContext(), "Config State reset. Please restart the app",
                 Toast.LENGTH_LONG).show();
        
        SharedPreferences prefs = PreferenceManager
                    .getDefaultSharedPreferences(getBaseContext());
        SharedPreferences.Editor editor = prefs.edit();
        editor.putString("camomatic_config_state", "false");
        editor.commit();
        return true;
      }
      
    });
  }

}




Java Source Code List

edu.uic.cs440.AudioPacketizer.java
edu.uic.cs440.CamOMaticActivity.java
edu.uic.cs440.PacketHandler.java
edu.uic.cs440.Preferences.java
edu.uic.cs440.Utils.java
edu.uic.cs440.VideoPacketizer.java