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 AssetActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
retrieveSavedValuesFromBundle(savedInstanceState);
wrapper = new PhotosIntentWrapper(getIntent());
account = wrapper.getAccount();
filterType = wrapper.getFilterType();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (savedInstanceState == null) {
fragmentRoot = FragmentRoot.newInstance(account, filterType, selectedAccountsPositions, selectedImagesPositions, selectedVideosPositions);
ft.add(R.id.gcFragments, fragmentRoot, FragmentUtil.TAG_FRAGMENT_FOLDER).commit();
}
}
use of android.support.v4.app.FragmentTransaction in project photo-picker-plus-android by chute.
the class AssetActivity method onAccountFolderSelect.
@Override
public void onAccountFolderSelect(AccountModel account, String folderId) {
this.folderId = folderId;
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.gcFragments, FragmentSingle.newInstance(account, folderId, selectedAccountsPositions), FragmentUtil.TAG_FRAGMENT_FILES);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
Aggregations