ncosentino

Tab Fragment Tutorial - Classes - MainActivity.java

Oct 30th, 2013
1,773
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Blog Post:
  3.  * http://devleader.ca/2013/11/04/fragments-tabbed-android-user-interface
  4.  *
  5.  * Layouts:
  6.  * activity_main.xml: http://pastebin.com/kj8M38Ze
  7.  * fragment_tabs.xml: http://pastebin.com/0b7HAeAK
  8.  * simple_tab.xml: http://pastebin.com/9SqLbS0X
  9.  *
  10.  * Classes:
  11.  * MainActivity.java: http://pastebin.com/eBv3H775
  12.  * SimpleTabDefinition.java: http://pastebin.com/wW3WCcy9
  13.  * TabDefinition.java: http://pastebin.com/KSRV2f3U
  14.  * TabsFragment.java: http://pastebin.com/9Asv7AVH
  15.  */
  16. package com.devleader.tab_fragment_tutorial;
  17.  
  18. import android.os.Bundle;
  19. import android.support.v4.app.FragmentActivity;
  20. import android.view.Menu;
  21.  
  22. public class MainActivity extends FragmentActivity {
  23.     @Override
  24.     protected void onCreate(Bundle savedInstanceState) {
  25.         super.onCreate(savedInstanceState);
  26.         setContentView(R.layout.activity_main);
  27.     }
  28.  
  29.     @Override
  30.     public boolean onCreateOptionsMenu(Menu menu) {
  31.         // Inflate the menu; this adds items to the action bar if it is present.
  32.         getMenuInflater().inflate(R.menu.main, menu);
  33.         return true;
  34.     }
  35. }
RAW Paste Data