Back to project page GeoCarDroid.
The source code is released under:
GNU General Public License
If you think the Android project GeoCarDroid 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.geocar.geocarconnect; /* w w w .j ava 2 s .c o m*/ import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.os.Bundle; import android.preference.PreferenceFragment; public class PrefActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Display the fragment as the main content. FragmentManager mFragmentManager = getFragmentManager(); FragmentTransaction mFragmentTransaction = mFragmentManager .beginTransaction(); PrefsFragment mPrefsFragment = new PrefsFragment(); mFragmentTransaction.replace(android.R.id.content, mPrefsFragment); mFragmentTransaction.commit(); // We could have condensed the 5 lines into 1 line of code. // getFragmentManager().beginTransaction() // .replace(android.R.id.content, new PrefsFragment()).commit(); } public static class PrefsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.preferences); } } }