android.support.v7.preference.Preference.getFragment()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中android.support.v7.preference.Preference.getFragment()方法的一些代码示例,展示了Preference.getFragment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preference.getFragment()方法的具体详情如下:
包路径:android.support.v7.preference.Preference
类名称:Preference
方法名:getFragment

Preference.getFragment介绍

暂无

代码示例

代码示例来源:origin: TeamNewPipe/NewPipe

@Override
  public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference preference) {
    Fragment fragment = Fragment.instantiate(this, preference.getFragment(), preference.getExtras());
    getSupportFragmentManager().beginTransaction()
        .setCustomAnimations(R.animator.custom_fade_in, R.animator.custom_fade_out, R.animator.custom_fade_in, R.animator.custom_fade_out)
        .replace(R.id.fragment_holder, fragment)
        .addToBackStack(null)
        .commit();
    return true;
  }
}

代码示例来源:origin: jberkel/sms-backup-plus

@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference preference) {
  if (LOCAL_LOGV) {
    Log.v(TAG, "onPreferenceStartFragment(" + preference + ")");
  }
  final Fragment fragment = Fragment.instantiate(
    this,
    preference.getFragment(),
    new BundleBuilder().putInt(SCREEN_TITLE_RES, preferenceTitles.getTitleRes(preference.getKey())).build());
  showFragment(fragment, preference.getKey());
  return true;
}

代码示例来源:origin: MoMoWait/LeanbackLauncher

public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
  Fragment f = Fragment.instantiate(getActivity(), pref.getFragment(), pref.getExtras());
  f.setTargetFragment(caller, 0);
  startPreferenceFragment(f);
  return true;
}

相关文章