本文整理汇总了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");
}
示例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();
}
示例3: provideFeedPagerAdapter
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
FeedPagerAdapter provideFeedPagerAdapter(AppCompatActivity activity) {
return new FeedPagerAdapter(activity.getSupportFragmentManager());
}
示例4: activityFragmentManager
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
@Named(ACTIVITY_FRAGMENT_MANAGER)
@PerActivity
static FragmentManager activityFragmentManager(AppCompatActivity activity) {
return activity.getSupportFragmentManager();
}
示例5: UIRouter
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public UIRouter(@NonNull final AppCompatActivity activity) {
mContext = activity;
mFragmentManager = activity.getSupportFragmentManager();
}
示例6: FragmentMaster
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
FragmentMaster(AppCompatActivity activity) {
mActivity = activity;
mFragmentManager = activity.getSupportFragmentManager();
mEventDispatcher = new MasterEventDispatcher(activity);
}
示例7: CmdPagerAdapter
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public CmdPagerAdapter(AppCompatActivity activity) {
super(activity.getSupportFragmentManager());
mActivity = activity;
}
示例8: fragmentManager
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
public static FragmentManager fragmentManager(AppCompatActivity activity) {
return activity.getSupportFragmentManager();
}
示例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);
}
示例10: providesFragmentManager
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
@Provides
FragmentManager providesFragmentManager(AppCompatActivity activity) {
return activity.getSupportFragmentManager();
}