Android Open Source - MoonCal Settings Activity






From Project

Back to project page MoonCal.

License

The source code is released under:

GNU General Public License

If you think the Android project MoonCal 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.example.mooncal;
/*from www.j  ava  2  s.  c  om*/
import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.view.MenuItem;

public class SettingsActivity extends Activity {
  public static final String SOUTHHEMI="pref_south_hemi";
  public static final String WEEKDAY1="pref_weekstart1";
  public static class SettingsFragment extends PreferenceFragment {
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.prefs);
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getFragmentManager().beginTransaction()
    .replace(android.R.id.content, new SettingsFragment())
    .commit();
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  public boolean onMenuItemSelected(int featureId,MenuItem item) {
    int itemid=item.getItemId();
    if(itemid==android.R.id.home) {
      onBackPressed();
      return true;
    }
    return super.onMenuItemSelected(featureId, item);
  }
}




Java Source Code List

com.example.mooncal.AboutDialogPreference.java
com.example.mooncal.MainActivity.java
com.example.mooncal.MonthPickerFragment.java
com.example.mooncal.MoonDayView.java
com.example.mooncal.MoonphaseCalculator.java
com.example.mooncal.SettingsActivity.java