当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceFragment类代码示例

本文整理汇总了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;
}
 
开发者ID:JimSeker,项目名称:saveData,代码行数:19,代码来源:myPreferenceActivity.java

示例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;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:9,代码来源:SettingsFragment.java

示例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;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:9,代码来源:SettingsFragment.java

示例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;
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:10,代码来源:SettingsFragment.java

示例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;
}
 
开发者ID:ITVlab,项目名称:Family-Calendar,代码行数:9,代码来源:SettingsFragment.java

示例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;
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:8,代码来源:SettingsExampleFragment.java

示例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;
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:9,代码来源:SettingsExampleFragment.java

示例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;
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:8,代码来源:SettingsFragment.java

示例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);
    }
}
 
开发者ID:googlesamples,项目名称:android-testdpc,代码行数:11,代码来源:Util.java

示例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;
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:10,代码来源:TVSettingsFragment.java

示例11: onPreferenceStartFragment

import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment,
    Preference preference) {
    return false;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:6,代码来源:SettingsFragment.java

示例12: onPreferenceStartFragment

import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment,
                                         Preference preference) {
    return false;
}
 
开发者ID:ITVlab,项目名称:Family-Calendar,代码行数:6,代码来源:SettingsFragment.java

示例13: findPreference

import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public Preference findPreference(CharSequence prefKey) {
    return ((PreferenceFragment) fragments.peek()).findPreference(prefKey);
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:5,代码来源:SettingsExampleFragment.java

示例14: onPreferenceStartFragment

import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
    return false;
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:5,代码来源:SettingsFragment.java

示例15: onPreferenceStartFragment

import android.support.v14.preference.PreferenceFragment; //导入依赖的package包/类
@Override
public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment, Preference preference) {
    return false;
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:5,代码来源:TVSettingsFragment.java


注:本文中的android.support.v14.preference.PreferenceFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。