use of android.support.v4.app.FragmentManager in project HoloEverywhere by Prototik.
the class DatePreference method getDatePickerDialog.
private DatePickerDialog getDatePickerDialog(boolean create) {
if (mDatePickerDialog == null && create) {
mDatePickerDialog = DatePickerDialog.newInstance(mCallback, mYear, mMonth, mDay);
mDatePickerDialog.setForceNotShow(true);
final FragmentManager fm = Activity.extract(getContext(), true).getSupportFragmentManager();
final FragmentTransaction ft = fm.beginTransaction();
ft.add(mDatePickerDialog, getClass().getName() + "@" + getKey());
ft.commitAllowingStateLoss();
fm.executePendingTransactions();
}
return mDatePickerDialog;
}
use of android.support.v4.app.FragmentManager in project paper-onboarding-android by Ramotion.
the class FragmentsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragments_activity_layout);
fragmentManager = getSupportFragmentManager();
final PaperOnboardingFragment onBoardingFragment = PaperOnboardingFragment.newInstance(getDataForOnboarding());
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.fragment_container, onBoardingFragment);
fragmentTransaction.commit();
onBoardingFragment.setOnRightOutListener(new PaperOnboardingOnRightOutListener() {
@Override
public void onRightOut() {
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Fragment bf = new BlankFragment();
fragmentTransaction.replace(R.id.fragment_container, bf);
fragmentTransaction.commit();
}
});
}
use of android.support.v4.app.FragmentManager in project RoboBinding-gallery by RoboBinding.
the class AbstractFragmentActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.fragmentContainer);
if (fragment == null) {
fragment = createFragment();
fm.beginTransaction().add(R.id.fragmentContainer, fragment).commit();
}
}
use of android.support.v4.app.FragmentManager in project RxJava-Android-Samples by kaushikgopal.
the class RotationPersist1Fragment method startOperationFromWorkerFrag.
// -----------------------------------------------------------------------------------
@OnClick(R.id.btn_rotate_persist)
public void startOperationFromWorkerFrag() {
_logs = new ArrayList<>();
_adapter.clear();
FragmentManager fm = getActivity().getSupportFragmentManager();
RotationPersist1WorkerFragment frag = (RotationPersist1WorkerFragment) fm.findFragmentByTag(RotationPersist1WorkerFragment.TAG);
if (frag == null) {
frag = new RotationPersist1WorkerFragment();
fm.beginTransaction().add(frag, RotationPersist1WorkerFragment.TAG).commit();
} else {
Timber.d("Worker frag already spawned");
}
}
use of android.support.v4.app.FragmentManager in project barcodescanner by dm77.
the class FullScannerActivity method closeDialog.
public void closeDialog(String dialogName) {
FragmentManager fragmentManager = getSupportFragmentManager();
DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
if (fragment != null) {
fragment.dismiss();
}
}
Aggregations