本文整理汇总了Java中android.support.v14.preference.PreferenceFragment类的典型用法代码示例。如果您正苦于以下问题:Java PreferenceFragment类的具体用法?Java PreferenceFragment怎么用?Java PreferenceFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreferenceFragment类属于android.support.v14.preference包,在下文中一共展示了PreferenceFragment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment, PreferenceScreen preferenceScreen) {
Log.wtf("Hi", "i'm called.");
//first get the new rootkey (ie, moving to the next screen, so which one if more then one.
Bundle args = new Bundle();
args.putString(PreferenceFragment.ARG_PREFERENCE_ROOT, preferenceScreen.getKey()); //get the new root key
//now add that to the fragmenet
PrefFrag fragment = new PrefFrag();
fragment.setArguments(args);
//now show the new fragment.
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(android.R.id.content, fragment, preferenceScreen.getKey());
ft.addToBackStack(preferenceScreen.getKey());
ft.commit();
return true;
}
示例2: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment,
PreferenceScreen preferenceScreen) {
PreferenceFragment frag = buildPreferenceFragment(R.xml.settings,
preferenceScreen.getKey());
startPreferenceFragment(frag);
return true;
}
示例3: buildPreferenceFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
private PreferenceFragment buildPreferenceFragment(int preferenceResId, String root) {
PreferenceFragment fragment = new PrefFragment();
Bundle args = new Bundle();
args.putInt(PREFERENCE_RESOURCE_ID, preferenceResId);
args.putString(PREFERENCE_ROOT, root);
fragment.setArguments(args);
return fragment;
}
示例4: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment,
PreferenceScreen preferenceScreen) {
PreferenceFragment frag = buildPreferenceFragment(R.xml.settings,
preferenceScreen.getKey());
startPreferenceFragment(frag);
return true;
}
示例5: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment,
PreferenceScreen preferenceScreen) {
PreferenceFragment frag = buildPreferenceFragment(R.xml.preferences,
preferenceScreen.getKey());
startPreferenceFragment(frag);
return true;
}
示例6: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment,
PreferenceScreen preferenceScreen) {
PreferenceFragment frag = buildPreferenceFragment(R.xml.prefs, preferenceScreen.getKey());
startPreferenceFragment(frag);
return true;
}
示例7: buildPreferenceFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
private PreferenceFragment buildPreferenceFragment(int preferenceResId, String root) {
PreferenceFragment fragment = new PrefFragment();
Bundle args = new Bundle();
args.putInt("preferenceResource", preferenceResId);
args.putString("root", root);
fragment.setArguments(args);
return fragment;
}
示例8: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(final PreferenceFragment preferenceFragment,
final PreferenceScreen preferenceScreen) {
final PreferenceFragment frag = buildPreferenceFragment(R.xml.prefs, preferenceScreen.getKey());
startPreferenceFragment(frag);
return true;
}
示例9: showFileViewerForImportingCertificate
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
public static void showFileViewerForImportingCertificate(PreferenceFragment fragment,
int requestCode) {
Intent certIntent = new Intent(Intent.ACTION_GET_CONTENT);
certIntent.setTypeAndNormalize("*/*");
try {
fragment.startActivityForResult(certIntent, requestCode);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "showFileViewerForImportingCertificate: ", e);
}
}
示例10: onPreferenceStartScreen
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartScreen(PreferenceFragment caller, PreferenceScreen pref) {
final Fragment prefsFragment = PrefsFragment.newInstance();
final Bundle args = new Bundle();
args.putString(PreferenceFragment.ARG_PREFERENCE_ROOT, pref.getKey());
prefsFragment.setArguments(args);
startPreferenceFragment(prefsFragment);
return true;
}
示例11: onPreferenceStartFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment,
Preference preference) {
return false;
}
示例12: onPreferenceStartFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment,
Preference preference) {
return false;
}
示例13: findPreference
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public Preference findPreference(CharSequence prefKey) {
return ((PreferenceFragment) fragments.peek()).findPreference(prefKey);
}
示例14: onPreferenceStartFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
return false;
}
示例15: onPreferenceStartFragment
import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment, Preference preference) {
return false;
}