use of android.app.FragmentTransaction in project android_frameworks_base by DirtyUnicorns.
the class RecentsCreateFragment method show.
public static void show(FragmentManager fm) {
final RecentsCreateFragment fragment = new RecentsCreateFragment();
final FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.container_directory, fragment);
ft.commitAllowingStateLoss();
}
use of android.app.FragmentTransaction in project android_frameworks_base by DirtyUnicorns.
the class DirectoryFragment method create.
public static void create(FragmentManager fm, int type, RootInfo root, DocumentInfo doc, String query, int anim) {
final Bundle args = new Bundle();
args.putInt(Shared.EXTRA_TYPE, type);
args.putParcelable(Shared.EXTRA_ROOT, root);
args.putParcelable(Shared.EXTRA_DOC, doc);
args.putString(Shared.EXTRA_QUERY, query);
args.putParcelable(Shared.EXTRA_SELECTION, new Selection());
final FragmentTransaction ft = fm.beginTransaction();
AnimationView.setupAnimations(ft, anim, args);
final DirectoryFragment fragment = new DirectoryFragment();
fragment.setArguments(args);
ft.replace(getFragmentId(), fragment);
ft.commitAllowingStateLoss();
}
use of android.app.FragmentTransaction in project android_frameworks_base by DirtyUnicorns.
the class BiDiTestActivity method onListItemClick.
private void onListItemClick(ListView lv, View v, int position, long id) {
// Show the test
Map<String, Object> map = (Map<String, Object>) lv.getItemAtPosition(position);
int fragmentId = (Integer) map.get(KEY_FRAGMENT_ID);
Fragment fragment = getFragmentManager().findFragmentById(fragmentId);
if (fragment == null) {
try {
// Create an instance of the test
Class<? extends Fragment> clazz = (Class<? extends Fragment>) map.get(KEY_CLASS);
fragment = clazz.newInstance();
// Replace the old test fragment with the new one
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.testframe, fragment);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {
}
}
}
use of android.app.FragmentTransaction in project Ask-Permission by Kishanjvaghela.
the class DemoFragActivity method addFragment.
private void addFragment() {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.add(R.id.fragmentContentLayout, new DemoFragment());
transaction.commit();
}
use of android.app.FragmentTransaction in project Ask-Permission by Kishanjvaghela.
the class AskPermissionUtils method addFragment.
public static void addFragment(FragmentManager fragmentManager, Fragment fragment) {
if (fragmentManager == null) {
return;
}
if (fragment == null) {
return;
}
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(fragment, PERMISSION_TAG);
fragmentTransaction.commit();
}
Aggregations