use of android.support.v4.app.Fragment in project Android-PanesLibrary by cricklet.
the class ExampleActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setPaneSizer(new ExamplePaneSizer());
// Lets setup a menu and a first pane!
if (savedInstanceState == null) {
Fragment menu = new ExampleFragment();
Fragment first = new ExampleFragment();
setMenuFragment(menu);
addFragment(menu, first);
// if you wanted to add more fragments after these ones, you can do:
Fragment second = new ExampleFragment();
Fragment third = new ExampleFragment();
addFragment(first, second);
addFragment(second, third);
}
}
use of android.support.v4.app.Fragment in project Android-PanesLibrary by cricklet.
the class ExampleFragment method addExampleFragment.
/**
* Create a new ExampleFragment and add it!
*/
private void addExampleFragment() {
// create a new fragment
Fragment f = new ExampleFragment();
//Fragment f = new ExampleListFragment();
// get the activity and add the new fragment after this one!
Activity a = getActivity();
if (a != null && a instanceof FragmentLauncher)
((FragmentLauncher) a).addFragment(ExampleFragment.this, f);
}
use of android.support.v4.app.Fragment in project ActionBar-PullToRefresh by chrisbanes.
the class BaseSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Add the Sample Fragment if there is one
Fragment sampleFragment = getSampleFragment();
if (sampleFragment != null) {
getSupportFragmentManager().beginTransaction().replace(android.R.id.content, sampleFragment).commit();
}
}
use of android.support.v4.app.Fragment in project cw-android by commonsguy.
the class EU4You method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
CountriesFragment countries = (CountriesFragment) getSupportFragmentManager().findFragmentById(R.id.countries);
countries.setCountryListener(this);
Fragment f = getSupportFragmentManager().findFragmentById(R.id.details);
detailsInline = (f != null && (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE));
if (detailsInline) {
countries.enablePersistentSelection();
} else if (f != null) {
f.getView().setVisibility(View.GONE);
}
}
use of android.support.v4.app.Fragment in project barcodescanner by dm77.
the class FullScannerActivity method showMessageDialog.
public void showMessageDialog(String message) {
DialogFragment fragment = MessageDialogFragment.newInstance("Scan Results", message, this);
fragment.show(getSupportFragmentManager(), "scan_results");
}
Aggregations