use of android.support.v4.app.FragmentManager in project nmid-headline by miao1007.
the class HomeActivity method onNavigationDrawerItemSelected.
@Override
public void onNavigationDrawerItemSelected(int position) {
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = null;
switch(position) {
case 0:
fragment = new SlidingTabFragment();
break;
case 1:
fragment = new ImagesFeedFragment();
break;
case 2:
fragment = new FavFeedFragment();
break;
}
if (fragment != null) {
fragmentManager.beginTransaction().replace(R.id.base_fragment_container, fragment).commit();
}
}
use of android.support.v4.app.FragmentManager in project Signal-Android by WhisperSystems.
the class MmsPreferencesActivity method onCreate.
@Override
protected void onCreate(Bundle icicle, @NonNull MasterSecret masterSecret) {
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Fragment fragment = new MmsPreferencesFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, fragment);
fragmentTransaction.commit();
}
use of android.support.v4.app.FragmentManager in project Android-ObservableScrollView by ksoichiro.
the class FragmentActionBarControlListViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragmentactionbarcontrol);
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentByTag(FragmentTransitionDefaultFragment.FRAGMENT_TAG) == null) {
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.id.container, new FragmentActionBarControlListViewFragment(), FragmentActionBarControlListViewFragment.FRAGMENT_TAG);
ft.commit();
fm.executePendingTransactions();
}
}
use of android.support.v4.app.FragmentManager in project SeriesGuide by UweTrottmann.
the class AddListDialogFragment method showAddListDialog.
/**
* Display a dialog which allows to edit the title of this list or remove it.
*/
public static void showAddListDialog(FragmentManager fm) {
// DialogFragment.show() will take care of adding the fragment
// in a transaction. We also want to remove any currently showing
// dialog, so make our own transaction and take care of that here.
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag("addlistdialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = AddListDialogFragment.newInstance();
newFragment.show(ft, "addlistdialog");
}
use of android.support.v4.app.FragmentManager in project Signal-Android by WhisperSystems.
the class ApplicationPreferencesActivity method onSupportNavigateUp.
@Override
public boolean onSupportNavigateUp() {
FragmentManager fragmentManager = getSupportFragmentManager();
if (fragmentManager.getBackStackEntryCount() > 0) {
fragmentManager.popBackStack();
} else {
Intent intent = new Intent(this, ConversationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
return true;
}
Aggregations