Advertisement
Jgug

Fragment

Feb 4th, 2015
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public class MainActivity extends ActionBarActivity {
  2.  
  3.     @Override
  4.     protected void onCreate(Bundle savedInstanceState) {
  5.         super.onCreate(savedInstanceState);
  6.         setContentView(R.layout.activity_main);
  7.  
  8.         BlankFragment fragment = new BlankFragment();
  9.  
  10.         FragmentManager fragmentManager = getFragmentManager();
  11.         FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  12.  
  13.         fragmentTransaction.add(R.id.container, fragment);
  14.         fragmentTransaction.commit();
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement