use of android.app.Fragment in project SeriesGuide by UweTrottmann.
the class UpcomingEpisodeSettingsActivity method onCreate.
public void onCreate(Bundle savedInstanceState) {
// set a theme based on user preference
setTheme(SeriesGuidePreferences.THEME);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_singlepane);
setupActionBar();
if (savedInstanceState == null) {
Fragment f = new SettingsFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.add(R.id.content_frame, f);
ft.commit();
}
}
use of android.app.Fragment in project SeriesGuide by UweTrottmann.
the class SeriesGuidePreferences method switchToSettings.
public void switchToSettings(String settingsId) {
Bundle args = new Bundle();
args.putString(EXTRA_SETTINGS_SCREEN, settingsId);
Fragment f = new SettingsFragment();
f.setArguments(args);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.containerSettings, f);
ft.addToBackStack(null);
ft.commit();
}
use of android.app.Fragment in project SeriesGuide by UweTrottmann.
the class SeriesGuidePreferences method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(SeriesGuidePreferences.THEME);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
setupActionBar();
if (savedInstanceState == null) {
Fragment f = new SettingsFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.add(R.id.containerSettings, f);
ft.commit();
// open a sub settings screen if requested
String settingsScreen = getIntent().getStringExtra(EXTRA_SETTINGS_SCREEN);
if (settingsScreen != null) {
switchToSettings(settingsScreen);
}
}
}
use of android.app.Fragment in project Fairphone by Kwamecorp.
the class WallpaperChooser method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.wallpaper_chooser_base);
Fragment fragmentView = getFragmentManager().findFragmentById(R.id.wallpaper_chooser_fragment);
// needs to be revived again.
if (fragmentView == null) {
/* When the screen is XLarge, the fragment is not included in the layout, so show it
* as a dialog
*/
DialogFragment fragment = WallpaperChooserDialogFragment.newInstance();
fragment.show(getFragmentManager(), "dialog");
}
}
use of android.app.Fragment 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);
}
Aggregations