The tab type app's main interface has the following 1. Early type: Viewpager + multiple layout files, the bottom can be linearlayout or RadioButton, by clicking on the bottom of the time to constantly change the Viewpager Setcurrentpager (), you can achieve the tab switch. 2. Android3.0 started using fragment, implemented through Fragmentmanager + fragment. This method does not use Viewpager, so you cannot implement a screen transition effect dragged by your finger. 3. Viewpager + Fragmentpageradapter, which is the way of this course, combines the advantages of the above two points to achieve both left and right drag effects, and also to achieve the separation of code, That is, the contents of each tab in the blank area are a fragment and can be dragged left and right. 4. Early and not recommended by Google Way: Tabhost. If you do not need to drag left and right, but just click to switch, it is recommended to use the 2nd way: Layout more flexible, easy to reuse.
Android Studio Shortcut: Ctrl + Alt + M, you can extract the selected piece of code into a separate method. On Eclipse is the alt+shift+m.
Android Siege Lion tab type