Search in sources :

Example 46 with FragmentManager

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();
}
Also used : FragmentManager(android.app.FragmentManager) Intent(android.content.Intent)

Example 47 with FragmentManager

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);
}
Also used : FragmentManager(android.app.FragmentManager) Bundle(android.os.Bundle) Fragment(android.app.Fragment)

Example 48 with FragmentManager

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);
    }
}
Also used : FragmentManager(android.app.FragmentManager)

Example 49 with FragmentManager

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);
}
Also used : FragmentManager(android.app.FragmentManager) Bundle(android.os.Bundle) TimeZonePickerDialog(com.android.timezonepicker.TimeZonePickerDialog)

Example 50 with FragmentManager

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;
}
Also used : FragmentManager(android.app.FragmentManager) ArrayList(java.util.ArrayList) Fragment(android.app.Fragment)

Aggregations

FragmentManager (android.app.FragmentManager)177 FragmentTransaction (android.app.FragmentTransaction)84 Fragment (android.app.Fragment)51 Bundle (android.os.Bundle)22 DocumentInfo (com.android.documentsui.model.DocumentInfo)20 DialogFragment (android.app.DialogFragment)15 RootInfo (com.android.documentsui.model.RootInfo)15 ActionBar (android.support.v7.app.ActionBar)12 Intent (android.content.Intent)11 File (java.io.File)6 MediaRouter (android.media.MediaRouter)5 Uri (android.net.Uri)5 StorageManager (android.os.storage.StorageManager)5 VolumeInfo (android.os.storage.VolumeInfo)5 MenuItem (android.view.MenuItem)5 IOException (java.io.IOException)5 Toolbar (android.support.v7.widget.Toolbar)4 View (android.view.View)4 DialogInterface (android.content.DialogInterface)3 ViewGroup (android.view.ViewGroup)3