Search in sources :

Example 1 with FragmentManager

use of android.app.FragmentManager in project UltimateAndroid by cymcsg.

the class PercentSampleActivity method onNavigationDrawerItemSelected.

@Override
public void onNavigationDrawerItemSelected(int position) {
    // update the main content by replacing fragments
    FragmentManager fragmentManager = getFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.container, PlaceholderFragment.newInstance(position + 1)).commit();
}
Also used : FragmentManager(android.app.FragmentManager)

Example 2 with FragmentManager

use of android.app.FragmentManager in project meatspace-android by RomainPiel.

the class MainActivity method showSettings.

/**
     * show settings dialog
     */
private void showSettings() {
    FragmentManager fm = getFragmentManager();
    new SettingsFragment().show(fm, null);
}
Also used : FragmentManager(android.app.FragmentManager) SettingsFragment(com.romainpiel.lib.ui.fragment.SettingsFragment)

Example 3 with FragmentManager

use of android.app.FragmentManager in project FadingActionBar by ManuelPeinado.

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.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 4 with FragmentManager

use of android.app.FragmentManager in project NimbusBase_Android_Tutorial by NimbusBase.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Singleton.CONTEXT = getApplicationContext();
    Singleton.base();
    final FragmentManager fragmentManager = this.getFragmentManager();
    final IndexFragment indexFragment = (IndexFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG_INDEX);
    if (indexFragment == null) {
        final IndexFragment newIndexFragment = new IndexFragment();
        fragmentManager.beginTransaction().replace(android.R.id.content, newIndexFragment, FRAGMENT_TAG_INDEX).commit();
    }
}
Also used : FragmentManager(android.app.FragmentManager)

Example 5 with FragmentManager

use of android.app.FragmentManager in project Klyph by jonathangerbaud.

the class DonateActivity method onActivityResult.

/**
	 * Needed for Google Play In-app Billing. It uses
	 * startIntentSenderForResult(). The result is not propagated to the
	 * Fragment like in startActivityForResult(). Thus we need to propagate
	 * manually to our Fragment.
	 * 
	 * @param requestCode
	 * @param resultCode
	 * @param data
	 */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    FragmentManager fragmentManager = getFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
    if (fragment != null) {
        ((DonateFragment) fragment).onActivityResult(requestCode, resultCode, data);
    }
}
Also used : FragmentManager(android.app.FragmentManager) DonateFragment(com.abewy.android.apps.klyph.fragment.DonateFragment) Fragment(android.app.Fragment) DonateFragment(com.abewy.android.apps.klyph.fragment.DonateFragment)

Aggregations

FragmentManager (android.app.FragmentManager)153 FragmentTransaction (android.app.FragmentTransaction)64 Fragment (android.app.Fragment)34 DocumentInfo (com.android.documentsui.model.DocumentInfo)20 Bundle (android.os.Bundle)19 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 StorageManager (android.os.storage.StorageManager)5 VolumeInfo (android.os.storage.VolumeInfo)5 MenuItem (android.view.MenuItem)5 IOException (java.io.IOException)5 Uri (android.net.Uri)4 Toolbar (android.support.v7.widget.Toolbar)4 View (android.view.View)4 DialogInterface (android.content.DialogInterface)3 ViewGroup (android.view.ViewGroup)3