title: How to Change AppCompatActivity to Fragment
body: <p>I am a newbie at develop android app. My tab use fragment but i follow tutorial that use AppCompatActivity can not combine them. I want to learn how to change AppCompatActivity into Fragment.</p>
  
  <p>There are my some code:</p>
  
  <p><strong>UserInfo.java</strong>This part should use fragment.</p>
  
  <pre><code>public class UserInfo extends AppCompatActivity{
  
      @Bind(R.id.passport_type)
      BetterSpinner spinner_passport;
  
      public UserInfo() {
          // Required empty public constructor
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.user_info);
          ButterKnife.bind(this);
  
          String[] list = getResources().getStringArray(R.array.passport_type);
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_dropdown_item_1line, list);
  
          spinner_passport.setAdapter(adapter);
      }
  
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.user_info, container, false);
      }
  
  }
  </code></pre>
  
  <p>This is error occurred code:</p>
  
  <pre><code>private void setupViewPager(ViewPager viewPager) {
          ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
          adapter.addFragment(new UserInfo(), "个人信息");
          adapter.addFragment(new TwoFragment(), "健康信息");
          adapter.addFragment(new ThreeFragment(), "个人证件");
          viewPager.setAdapter(adapter);
      }
  </code></pre>
  
  <p>new UserInfo() has error.
  Error Message is:</p>
  
  <pre><code>Wrong 1st argument type. Found: 'com.chinatown.wangjian.chinatown_userprofile.UserInfo', required: 'android.support.v4.app.Fragment' less... 
  
  addFragment
  (android.support.v4.app.Fragment,
  String)
  in ViewPagerAdapter cannot be applied
  to
  (com.chinatown.wangjian.chinatown_userprofile.UserInfo,
  String)
  </code></pre>
  
  <p>I  really want to learn how to change to Fragment any tutorial or any help will be appreciated. thanks so much! And i will upload more details if needed.</p>