use of android.app.FragmentTransaction in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SettingsActivity method startPreferenceFragment.
/**
* Start a new fragment.
*
* @param fragment The fragment to start
* @param push If true, the current fragment will be pushed onto the back stack. If false,
* the current fragment will be replaced.
*/
public void startPreferenceFragment(Fragment fragment, boolean push) {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.main_content, fragment);
if (push) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
transaction.addToBackStack(BACK_STACK_PREFS);
} else {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
}
transaction.commitAllowingStateLoss();
}
use of android.app.FragmentTransaction in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ViewPager pager = (ViewPager) findViewById(R.id.pager);
if (pager == null) {
if (getFragmentManager().findFragmentById(R.id.editor1) == null) {
SamplePagerAdapter adapter = buildAdapter();
FragmentTransaction ft = getFragmentManager().beginTransaction();
populateColumn(getFragmentManager(), ft, adapter, 0, R.id.editor1);
populateColumn(getFragmentManager(), ft, adapter, 1, R.id.editor2);
populateColumn(getFragmentManager(), ft, adapter, 2, R.id.editor3);
ft.commit();
}
} else {
SamplePagerAdapter adapter = buildAdapter();
pager.setAdapter(adapter);
}
}
use of android.app.FragmentTransaction in project superCleanMaster by joyoyao.
the class DialogUtil method showAlertDialog.
/**
* 显示一个一般的对话框(String内容).
* @param context
*
*/
public static AlertDialogFragment showAlertDialog(Context context, String message) {
FragmentActivity activity = (FragmentActivity) context;
AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, message, null, null);
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
// 指定一个系统转场动画
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
newFragment.show(ft, mDialogTag);
return newFragment;
}
use of android.app.FragmentTransaction in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class MapPrefActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapPrefFragment settingsFragment = new MapPrefFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, settingsFragment);
fragmentTransaction.commit();
}
use of android.app.FragmentTransaction in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class PrefActivity method loadFragment.
private void loadFragment() {
PrefFragment settingsFragment = new PrefFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, settingsFragment);
fragmentTransaction.commit();
}
Aggregations