Android Open Source - fco-alerts-app Settings Display






From Project

Back to project page fco-alerts-app.

License

The source code is released under:

MIT License

If you think the Android project fco-alerts-app 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 uk.co.eleusis.android.fcoalerts;
/*from   ww  w  . j  av a2  s  .  c  om*/
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.MenuItem;

/**
 * Settings - list of countries etc
 * 
 * @author keithm
 *
 */
public class SettingsDisplay extends PreferenceActivity 
{
     @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      
      addBackButtonToActionBar();
      
      // Display the fragment as the main content.
      getFragmentManager().beginTransaction()
              .replace(android.R.id.content, new CountryPrefs())
              .commit();
  
     }

     @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  private void addBackButtonToActionBar()
     {
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
       {
          ActionBar actionBar = getActionBar();
          actionBar.setDisplayHomeAsUpEnabled(true);
          actionBar.setHomeButtonEnabled(true);
       }
     }
     
     @Override
     public void onPause()
     {
       super.onPause();
        overridePendingTransition(android.R.anim.fade_in, R.anim.slide_out_left);
     }
     
     @Override
     public boolean onOptionsItemSelected(MenuItem menuItem)
     {
       if (menuItem.getItemId() == android.R.id.home)
       {
         onBackPressed();
           return true;
       }
       else
       {
         return super.onOptionsItemSelected(menuItem);
       }
     }
     
     @Override
     protected boolean isValidFragment(String fragmentName)
     {
       return (fragmentName == "CountryPrefs");
     }
}




Java Source Code List

uk.co.eleusis.android.fcoalerts.Constants.java
uk.co.eleusis.android.fcoalerts.CountryPrefs.java
uk.co.eleusis.android.fcoalerts.GCMRegistration.java
uk.co.eleusis.android.fcoalerts.GcmBroadcastReceiver.java
uk.co.eleusis.android.fcoalerts.GcmIntentService.java
uk.co.eleusis.android.fcoalerts.MainActivity.java
uk.co.eleusis.android.fcoalerts.NotificationDeleteReceiver.java
uk.co.eleusis.android.fcoalerts.NotificationForwardReceiver.java
uk.co.eleusis.android.fcoalerts.NotificationStore.java
uk.co.eleusis.android.fcoalerts.NotifiedAlert.java
uk.co.eleusis.android.fcoalerts.Notifier.java
uk.co.eleusis.android.fcoalerts.RegidChangeListener.java
uk.co.eleusis.android.fcoalerts.ServerComms.java
uk.co.eleusis.android.fcoalerts.SettingsDisplay.java