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();
}
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);
}
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);
}
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();
}
}
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);
}
}
Aggregations