title: Creating Swipe Views with tabs in Android 5.0
body: <p>In making the swipe tabbed layout as below prior to Android 5.0:</p>
  
  <p><img src="https://i.stack.imgur.com/IZGep.png" alt="enter image description here"></p>
  
  <p>Simply required the code as:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      final ActionBar actionBar = getActionBar();
      ...
  
      // Specify that tabs should be displayed in the action bar.
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
      // Create a tab listener that is called when the user changes tabs.
      ActionBar.TabListener tabListener = new ActionBar.TabListener() {
          public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
              // show the given tab
          }
  
          public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
              // hide the given tab
          }
  
          public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
              // probably ignore this event
          }
      };
  
      // Add 3 tabs, specifying the tab's text and TabListener
      for (int i = 0; i &lt; 3; i++) {
          actionBar.addTab(
                  actionBar.newTab()
                          .setText("Tab " + (i + 1))
                          .setTabListener(tabListener));
      }
  }
  </code></pre>
  
  <p>But given the methods for navigation on the ActionBar are deprecated, How can I implement this type of view to be compatible withe Android 5.0 and previous versions?</p>