本文整理汇总了Java中android.support.v4.app.FragmentManager.OnBackStackChangedListener类的典型用法代码示例。如果您正苦于以下问题:Java OnBackStackChangedListener类的具体用法?Java OnBackStackChangedListener怎么用?Java OnBackStackChangedListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnBackStackChangedListener类属于android.support.v4.app.FragmentManager包,在下文中一共展示了OnBackStackChangedListener类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public static void setupOnBackStackChangedListener(NavigationManager paramNavigationManager)
{
FragmentManager.OnBackStackChangedListener local1 = new FragmentManager.OnBackStackChangedListener()
{
public final void onBackStackChanged()
{
PreviewPlayer localPreviewPlayer1 = PreviewController.mPlayer;
Utils.ensureOnMainThread();
localPreviewPlayer1.mQueue.clear();
PreviewPlayer localPreviewPlayer2 = PreviewController.mPlayer;
switch (localPreviewPlayer2.mPlayer.mCurrentState)
{
}
for (;;)
{
PreviewController.mPlayer.reset();
this.val$navigationManager.removeOnBackStackChangedListener(this);
return;
localPreviewPlayer2.mPlayer.stop();
}
}
};
paramNavigationManager.removeOnBackStackChangedListener(local1);
paramNavigationManager.addOnBackStackChangedListener(local1);
}
示例2: onCreate
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
supportInvalidateOptionsMenu();
}
});
if (savedInstanceState == null) {
mPlayerCountFragment = new PlayerCountFragment();
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.add(android.R.id.content, mPlayerCountFragment, PlayerCountFragment.TAG);
ft.commit();
}
else {
mPlayerCountFragment = Ui.findFragment(this, PlayerCountFragment.TAG);
mWhoGoesFragment = Ui.findFragment(this, WhoGoesFragment.TAG);
}
}
示例3: reportBackStackChanged
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
void reportBackStackChanged() {
if (this.mBackStackChangeListeners != null) {
for (int i = 0; i < this.mBackStackChangeListeners.size(); i++) {
((OnBackStackChangedListener) this.mBackStackChangeListeners.get(i)).onBackStackChanged();
}
}
}
示例4: setDefaultBackStackListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
/**
* * It called by {@link #onCreate(Bundle)}) from {@link BaseActivity} automatically. <br/>
* It used to add system default back stack.<br/>
*/
public void setDefaultBackStackListener() {
getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
BackStackSyncStatus();
}
});
}
示例5: addFragment
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public static void addFragment(FragmentManager supportFragmentManager, Fragment baseDialogFragment, int content, String tag) {
FragmentTransaction transaction = supportFragmentManager.beginTransaction();
transaction.setCustomAnimations(R.anim.anim_fragment_in, R.anim.anim_fragment_out, R.anim.anim_fragment_close_in, R.anim.anim_fragment_close_out);
Fragment fragment = supportFragmentManager.findFragmentById(content);
if (fragment != null) {
if (fragment instanceof OnBackStackChangedListener) {
supportFragmentManager.addOnBackStackChangedListener((OnBackStackChangedListener) fragment);
}
transaction.hide(fragment);
}
transaction.add(content, baseDialogFragment, tag);
transaction.addToBackStack(tag);
transaction.commitAllowingStateLoss();
}
示例6: addOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public void addOnBackStackChangedListener(OnBackStackChangedListener listener) {
if (this.mBackStackChangeListeners == null) {
this.mBackStackChangeListeners = new ArrayList();
}
this.mBackStackChangeListeners.add(listener);
}
示例7: removeOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public void removeOnBackStackChangedListener(OnBackStackChangedListener listener) {
if (this.mBackStackChangeListeners != null) {
this.mBackStackChangeListeners.remove(listener);
}
}
示例8: onCreate
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_main);
// enable ActionBar app icon to behave as action to toggle nav drawer
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
// ActionBarDrawerToggle ties together the the proper interactions
// between the sliding drawer and the action bar app icon
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.string.drawer_open, /*
* "open drawer" description for
* accessibility
*/
R.string.drawer_close /*
* "close drawer" description for
* accessibility
*/
) {
public void onDrawerClosed(View view) {
refreshTitle(false);
invalidateOptionsMenu(); // creates call to
// onPrepareOptionsMenu()
if (ActMain.this.getSupportFragmentManager().getBackStackEntryCount() > 1) {
mDrawerToggle.setDrawerIndicatorEnabled(false);
}
}
public void onDrawerOpened(View drawerView) {
refreshTitle(true);
invalidateOptionsMenu(); // creates call to
// onPrepareOptionsMenu()
mDrawerToggle.setDrawerIndicatorEnabled(true);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
if (savedInstanceState == null) {
addTopFragmentToStack();
}
getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
int count = ActMain.this.getSupportFragmentManager().getBackStackEntryCount();
if (count > 1) {
mDrawerToggle.setDrawerIndicatorEnabled(false);
} else {
mDrawerToggle.setDrawerIndicatorEnabled(true);
}
}
});
}
示例9: addOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public void addOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener)
{
this.mFragmentManager.addOnBackStackChangedListener(paramOnBackStackChangedListener);
}
示例10: removeOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public final void removeOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener)
{
this.mFragmentManager.removeOnBackStackChangedListener(paramOnBackStackChangedListener);
}
示例11: ActionBarHelper
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public ActionBarHelper(NavigationManager paramNavigationManager, ActionBarController paramActionBarController, ActionBarActivity paramActionBarActivity)
{
this.mActionBar = paramActionBarActivity.getDelegate().getSupportActionBar();
this.mToolbar = ((FinskySearchToolbar)paramActionBarActivity.findViewById(2131755196));
this.mActivity = paramActionBarActivity;
this.mNavigationManager = paramNavigationManager;
this.mActionBarController = paramActionBarController;
this.mActionBarStateStack = new Stack();
this.mActionBarStateStack.push(new ActionBarState(0, null));
this.mCurrentBackendId = 0;
if (this.mToolbar != null)
{
this.mToolbar.setCurrentBackendId(this.mCurrentBackendId);
this.mToolbar.setNavigationManager(this.mNavigationManager);
this.mToolbar.setActionBarController(this.mActionBarController);
this.mToolbar.setVisibility(4);
}
if (this.mToolbar != null) {
if ((!DotNotificationUtils.shouldShowAccountCompletionDotNotification()) || (((Integer)FinskyPreferences.accountCompletionMainMenuDotTapCount.get(FinskyApp.get().getCurrentAccountName()).get()).intValue() != 0)) {
break label306;
}
}
label306:
for (int i = 1;; i = 0)
{
if (i != 0)
{
View localView = this.mToolbar.getSearchView().findViewById(2131755724);
if (localView != null) {
localView.setVisibility(0);
}
this.mMainMenuUiElementNode = new GenericUiElementNode(5301, null, null, new GenericUiElementNode(5300, null, null, this.mNavigationManager.getActivePage()));
FinskyApp.get().getEventLogger().logPathImpression$7d139cbf(299, this.mMainMenuUiElementNode);
}
if (this.mActionBar != null) {
this.mActionBar.setBackgroundDrawable(getBackgroundColorDrawable(CorpusResourceUtils.getPrimaryColor(this.mActivity, 0)));
}
this.mTransparentBackgroundDrawable = new ColorDrawable(0);
paramNavigationManager.addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener()
{
public final void onBackStackChanged()
{
if (ActionBarHelper.sSawFirstBackstackChange) {
ActionBarHelper.this.clearSearch();
}
for (;;)
{
ActionBarHelper.this.syncState();
return;
ActionBarHelper.access$002$138603();
}
}
});
return;
}
}
示例12: onCreateView
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
/**
* OnCreateView
*
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// ----- Inflate the view ---------
if (vframelayout_main != null) {
//ViewGroup parent = (ViewGroup) vframelayout_main.getParent();
container.removeView(vframelayout_main);
} else {
vframelayout_main = inflater.inflate(R.layout.framelayout_map, container, false);
}
ctx = vframelayout_main.getContext();
//------- Add fragment_map ----
if (fmap_main==null){
fmap_main = SupportMapFragment.newInstance();
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.flmain, fmap_main);
fragmentTransaction.commit();
}
getFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
public void onBackStackChanged() {
if (fmap_main == null && !Fragment_Issue_Details.isVisible && FActivity_TabHost.IndexGroup==0){
onResume();
}
}
});
//-----------------------------
pbgeneral = (ProgressBar) vframelayout_main.findViewById(R.id.pbgeneral);
pbgeneral.bringToFront();
//---- Bind Location Service --------------
IntLocServ = new Intent(ctx, Service_Location.class);
if (!isLocServBound && FActivity_TabHost.IndexGroup == 0)
ctx.bindService(IntLocServ, mLocConnection, Context.BIND_AUTO_CREATE);
FActivity_TabHost.IndexGroup = 0;
//-----Start Data Service ------------
IntDataServ = new Intent(ctx, Service_Data.class);
ctx.startService(IntDataServ);
return vframelayout_main;
}
示例13: addOnBackStackChangedListener
import android.support.v4.app.FragmentManager.OnBackStackChangedListener; //导入依赖的package包/类
public final void addOnBackStackChangedListener(FragmentManager.OnBackStackChangedListener paramOnBackStackChangedListener) {}