use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.
the class SampleHmsUsingFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.frame_layout);
Fragment fragment = new SampleHmsFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.frame, fragment);
transaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.
the class TimePickerBuilder method show.
/**
* Instantiate and show the Picker
*/
public void show() {
if (manager == null || styleResId == null) {
Log.e("TimePickerBuilder", "setFragmentManager() and setStyleResId() must be called.");
return;
}
FragmentTransaction ft = manager.beginTransaction();
final Fragment prev = manager.findFragmentByTag("time_dialog");
if (prev != null) {
ft.remove(prev).commit();
ft = manager.beginTransaction();
}
ft.addToBackStack(null);
final TimePickerDialogFragment fragment = TimePickerDialogFragment.newInstance(mReference, styleResId);
if (targetFragment != null) {
fragment.setTargetFragment(targetFragment, 0);
}
fragment.setTimePickerDialogHandlers(mTimePickerDialogHandlers);
fragment.setOnDismissListener(mOnDismissListener);
fragment.show(ft, "time_dialog");
}
use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.
the class SampleDateUsingFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.frame_layout);
Fragment fragment = new SampleDateFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.frame, fragment);
transaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project TakePhoto by crazycodeboy.
the class SimpleFragmentActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_fragment_layout);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.fragment1, fragment = new SimpleFragment(), "test");
transaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project photo-picker-plus-android by chute.
the class FragmentUtil method replaceContentWithEmptyFragment.
public static void replaceContentWithEmptyFragment(FragmentActivity activity) {
FragmentTransaction fragmentTransaction = activity.getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.gcFragments, FragmentEmpty.newInstance(), TAG_FRAGMENT_EMPTY);
fragmentTransaction.commit();
}
Aggregations