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 material-camera by afollestad.
the class BaseCaptureActivity method onBackPressed.
@Override
public final void onBackPressed() {
Fragment frag = getFragmentManager().findFragmentById(R.id.container);
if (frag != null) {
if (frag instanceof PlaybackVideoFragment && allowRetry()) {
onRetry(((CameraUriInterface) frag).getOutputUri());
return;
} else if (frag instanceof BaseCameraFragment) {
((BaseCameraFragment) frag).cleanup();
} else if (frag instanceof BaseGalleryFragment && allowRetry()) {
onRetry(((CameraUriInterface) frag).getOutputUri());
return;
}
}
finish();
}
Aggregations