use of android.support.v4.app.FragmentTransaction in project fitscales by paulburton.
the class FitscalesActivity method oauthShowPage.
@Override
public void oauthShowPage(OAuthSyncService svc, String url) {
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog");
if (prev != null)
trans.remove(prev);
trans.addToBackStack(null);
DialogFragment nfrag = OAuthDialogFragment.newInstance(url, svc);
nfrag.show(trans, "dialog");
}
use of android.support.v4.app.FragmentTransaction in project fitscales by paulburton.
the class FitscalesActivity method onBoardWeighIn.
@Override
public void onBoardWeighIn(float weight) {
float prevWeight = Prefs.getLastWeight();
SharedPreferences.Editor edit = FitscalesApplication.inst.prefs.edit();
edit.putFloat(Prefs.KEY_LASTWEIGHT, weight);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD)
edit.apply();
else
edit.commit();
setScalePrev();
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog");
if (prev != null)
trans.remove(prev);
trans.addToBackStack(null);
DialogFragment nfrag = WeighInDialogFragment.newInstance(weight, prevWeight);
nfrag.show(trans, "dialog");
}
use of android.support.v4.app.FragmentTransaction in project Libraries-for-Android-Developers by eoecn.
the class ActionBarImpl method selectTab.
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
FragmentTransaction trans = null;
if (mActivity instanceof FragmentActivity) {
trans = ((FragmentActivity) mActivity).getSupportFragmentManager().beginTransaction().disallowAddToBackStack();
}
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
mTabScrollView.animateToTab(tab.getPosition());
}
} else {
mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
}
mSelectedTab = (TabImpl) tab;
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
}
}
if (trans != null && !trans.isEmpty()) {
trans.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();
}
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();
}
Aggregations