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


Java AppCompatActivity.getSupportFragmentManager方法代码示例

本文整理汇总了Java中android.support.v7.app.AppCompatActivity.getSupportFragmentManager方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatActivity.getSupportFragmentManager方法的具体用法?Java AppCompatActivity.getSupportFragmentManager怎么用?Java AppCompatActivity.getSupportFragmentManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.app.AppCompatActivity的用法示例。


在下文中一共展示了AppCompatActivity.getSupportFragmentManager方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showAbout

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public static void showAbout(AppCompatActivity activity) {
    FragmentManager fm = activity.getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag("dialog_about");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    new AboutDialog().show(ft, "dialog_about");
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:12,代码来源:Helpers.java

示例2: setFragmentTransaction

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public static void setFragmentTransaction(AppCompatActivity activity, int id, android.support.v4.app.Fragment fr)
{
	
	fragmentManager = activity.getSupportFragmentManager();
	
	FragmentTransaction requestFragment = fragmentManager.beginTransaction();
	requestFragment.replace(id, fr);
	requestFragment.commit();
}
 
开发者ID:MSay2,项目名称:Mire,代码行数:10,代码来源:Preferences.java

示例3: provideFeedPagerAdapter

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
FeedPagerAdapter provideFeedPagerAdapter(AppCompatActivity activity) {
    return new FeedPagerAdapter(activity.getSupportFragmentManager());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ActivityModule.java

示例4: activityFragmentManager

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
@Named(ACTIVITY_FRAGMENT_MANAGER)
@PerActivity
static FragmentManager activityFragmentManager(AppCompatActivity activity) {
    return activity.getSupportFragmentManager();
}
 
开发者ID:NamTranDev,项目名称:CleanArchitechture,代码行数:7,代码来源:BaseActivityModule.java

示例5: UIRouter

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public UIRouter(@NonNull final AppCompatActivity activity) {
	mContext = activity;
	mFragmentManager = activity.getSupportFragmentManager();
}
 
开发者ID:vivchar,项目名称:RendererRecyclerViewAdapter,代码行数:5,代码来源:UIRouter.java

示例6: FragmentMaster

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
FragmentMaster(AppCompatActivity activity) {
    mActivity = activity;
    mFragmentManager = activity.getSupportFragmentManager();
    mEventDispatcher = new MasterEventDispatcher(activity);
}
 
开发者ID:alphater,项目名称:garras,代码行数:6,代码来源:FragmentMaster.java

示例7: CmdPagerAdapter

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public CmdPagerAdapter(AppCompatActivity activity) {
    super(activity.getSupportFragmentManager());
    mActivity = activity;
}
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:5,代码来源:CmdPagerAdapter.java

示例8: fragmentManager

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
public static FragmentManager fragmentManager(AppCompatActivity activity) {
    return activity.getSupportFragmentManager();
}
 
开发者ID:aschattney,项目名称:dagger-test-example,代码行数:5,代码来源:ActivityModule.java

示例9: showAlways

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
/**
 * Shows the dialog without checking the value of {@link RateMyAppConfig#canShow()}.
 *
 * This implementation shows a dialog with three buttons. Each button calls a corresponding
 * method in the provided {@link DialogActionListener}, which can be overridden by the client to
 * customise behaviour as desired.
 *
 * The methods called by the buttons are the package-private
 * {@link DialogActionListener#storeButtonClicked(DialogFragment, RateMyAppConfig)},
 * {@link DialogActionListener#feedbackButtonClicked(DialogFragment, RateMyAppConfig)}, and
 * {@link DialogActionListener#dontAskAgainClicked(DialogFragment, RateMyAppConfig)} methods,
 *  rather than the public
 *  {@link DialogActionListener#onStoreButtonClicked(DialogFragment, RateMyAppConfig)},
 *  {@link DialogActionListener#onFeedbackButtonClicked(DialogFragment, RateMyAppConfig)} and
 *  {@link DialogActionListener#onDontAskAgainClicked(DialogFragment, RateMyAppConfig)}.
 *
 *  In {@link DialogFragment#onDetach()}, the {@link DialogActionListener} is set to {@code null}
 *  and the {@link DialogFragment#dismiss()} is called.
 *
 * @param activity the {@link AppCompatActivity} on which to show the {@link DialogFragment}.
 * @param config the {@link RateMyAppConfig} which will be used to configure the dialog
 * @param actionListener the {@link DialogActionListener} to use as a callback object for user
 *                       actions on the dialog
 */
public static void showAlways(@NonNull AppCompatActivity activity, @NonNull RateMyAppConfig config,
                              @NonNull DialogActionListener actionListener) {
    FragmentManager fragmentManager = activity.getSupportFragmentManager();

    RateMyAppDialog fragment;
    if (fragmentManager.findFragmentByTag(RMA_DIALOG_TAG) == null) {
        fragment = new RateMyAppDialog();
        fragment.config = config;
    } else {
        fragment = (RateMyAppDialog) fragmentManager.findFragmentByTag(RMA_DIALOG_TAG);
    }
    fragment.dialogActionListener = actionListener;

    FragmentTransaction transaction = fragmentManager.beginTransaction();
    transaction.addToBackStack(null);

    fragment.show(transaction, RMA_DIALOG_TAG);
}
 
开发者ID:zendesk,项目名称:rate_my_app_android,代码行数:43,代码来源:RateMyAppDialog.java

示例10: providesFragmentManager

import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
FragmentManager providesFragmentManager(AppCompatActivity activity) {
    return activity.getSupportFragmentManager();
}
 
开发者ID:teeeeeegz,项目名称:DuckDuckDefine-Android,代码行数:5,代码来源:ActivityModule.java


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