Skip to content

Repository files navigation

FragmentExample

  • Example 1
<fragmentandroid:id="@+id/fr_1"android:name="com.gzeinnumer.fragmentexample.FirstFragment"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_weight="1" />
  • Example 2
<FrameLayoutandroid:id="@+id/fr_2"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_weight="1" />
FragmentManagerfragmentManager = getSupportFragmentManager();
FragmentTransactionfragmentTransaction = fragmentManager.beginTransaction();
Fragmentfragment = newFirstFragment();
fragmentTransaction.replace(R.id.fr_2, fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();

Copyright 2020 M. Fadli Zein

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages