首页 > 代码库 > Android 隐藏Fragment

Android 隐藏Fragment

 1.隐藏Fragment

  FragmentManager fManager = getFragmentManager();                    fManager.beginTransaction()                            .setCustomAnimations(android.R.animator.fade_in,                                    android.R.animator.fade_out)                            .show(yourFragmentName).commit();

  

 fManager.beginTransaction().remove(mMangerFragment);

  

2.查看是否锁屏

KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
boolean locked = km.inKeyguardRestrictedInputMode();