use of android.app.FragmentManager in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class TestFragmentActivity method onCreate.
@Override
protected void onCreate(final Bundle savedState) {
super.onCreate(savedState);
final Intent intent = getIntent();
final String fragmentName = intent.getStringExtra(EXTRA_SHOW_FRAGMENT);
if (fragmentName == null) {
throw new IllegalArgumentException("No fragment name specified for testing");
}
mFragment = Fragment.instantiate(this, fragmentName);
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().add(mFragment, fragmentName).commit();
}
use of android.app.FragmentManager in project UltimateAndroid by cymcsg.
the class NavigationDrawerActivity method selectItem.
private void selectItem(int position) {
// update the main content by replacing fragments
Fragment fragment = new SampleFragment();
Bundle args = new Bundle();
args.putInt(SampleFragment.ARG_IMAGE_RES, mCityImages[position]);
args.putInt(SampleFragment.ARG_ACTION_BG_RES, R.drawable.fading_actionbar_ab_background);
fragment.setArguments(args);
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
setTitle(mCityNames[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}
use of android.app.FragmentManager in project Etar-Calendar by Etar-Group.
the class EventInfoFragment method showEventColorPickerDialog.
private void showEventColorPickerDialog() {
if (mColorPickerDialog == null) {
mColorPickerDialog = EventColorPickerDialog.newInstance(mColors, mCurrentColor, mCalendarColor, mIsTabletConfig);
mColorPickerDialog.setOnColorSelectedListener(this);
}
final FragmentManager fragmentManager = getFragmentManager();
fragmentManager.executePendingTransactions();
if (!mColorPickerDialog.isAdded()) {
mColorPickerDialog.show(fragmentManager, COLOR_PICKER_DIALOG_TAG);
}
}
use of android.app.FragmentManager in project Etar-Calendar by Etar-Group.
the class EditEventView method showTimezoneDialog.
private void showTimezoneDialog() {
Bundle b = new Bundle();
b.putLong(TimeZonePickerDialog.BUNDLE_START_TIME_MILLIS, mStartTime.toMillis(false));
b.putString(TimeZonePickerDialog.BUNDLE_TIME_ZONE, mTimezone);
FragmentManager fm = mActivity.getFragmentManager();
TimeZonePickerDialog tzpd = (TimeZonePickerDialog) fm.findFragmentByTag(FRAG_TAG_TIME_ZONE_PICKER);
if (tzpd != null) {
tzpd.dismiss();
}
tzpd = new TimeZonePickerDialog();
tzpd.setArguments(b);
tzpd.setOnTimeZoneSetListener(EditEventView.this);
tzpd.show(fm, FRAG_TAG_TIME_ZONE_PICKER);
}
use of android.app.FragmentManager in project WordPress-Android by wordpress-mobile.
the class ReaderSubsActivity method getPageAdapter.
private SubsPageAdapter getPageAdapter() {
if (mPageAdapter == null) {
List<Fragment> fragments = new ArrayList<>();
fragments.add(ReaderTagFragment.newInstance());
fragments.add(ReaderBlogFragment.newInstance(ReaderBlogType.FOLLOWED));
fragments.add(ReaderBlogFragment.newInstance(ReaderBlogType.RECOMMENDED));
FragmentManager fm = getFragmentManager();
mPageAdapter = new SubsPageAdapter(fm, fragments);
}
return mPageAdapter;
}
Aggregations