Back to project page arxiv-mobile.
The source code is released under:
GNU General Public License
If you think the Android project arxiv-mobile 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 com.commonsware.android.arXiv; /* w w w . j a v a2 s . c om*/ import android.annotation.SuppressLint; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.os.Bundle; import android.preference.PreferenceFragment; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; @SuppressLint("NewApi") // This only gets called on API level >= 11 public class EditPreferences extends ActionBarActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar ab = getSupportActionBar(); ab.setTitle("Preferences"); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.replace(android.R.id.content, new PrefsFragment()); ft.commit(); } public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); return true; } return super.onOptionsItemSelected(item); } public static class PrefsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } } }