title: Fragment Error with Parse
body: <p>I am using tabs to do a project. I am getting the following error. attach(android.support.v4.app.Fragment) in android.support.v4.app.FragmentTransaction cannot be applied to (com.outdeh.EventsFragment).</p>
  
  <pre><code>package com.outdeh;
  
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentActivity;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.content.Context;
  
  import com.parse.Parse;
  import com.parse.ParseAnalytics;
  import com.parse.ParseObject;
  import com.parse.PushService;
  
  
  public class EventsFragment extends FragmentActivity {
  
      @Override
      public void onCreate(Bundle savedInstanceState){
  
  
          // Parse.initialize(this, "nSXPAwYG29VZMaCkasdjhakhsdkjsahdhj", "PWeiawu25r7sAmOYdgP0kajhsdkahaskjdhashj");
  
         // ParseObject testObject = new ParseObject("TestObject");
          //testObject.put("foo", "bar new");
          //testObject.saveInBackground();
  
      }
  
      public EventsFragment() {
          //Required empty public constructor
      }
  
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          //Inflate the layout for this fragment
          return inflater.inflate(R.layout.event_fragment, container, false);
      }
  }
  
  
  
  
  
  
  package com.outdeh;
  
  import com.outdeh.R;
  import android.os.Bundle;
  import android.os.StrictMode;
  import android.support.v4.app.FragmentActivity;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.TabHost;
  import android.support.v4.app.Fragment;
  
  import com.parse.Parse;
  import com.parse.ParseAnalytics;
  import com.parse.PushService;
  import com.parse.ParseInstallation;
  
  public class MainActivity extends FragmentActivity {
      TabHost tHost;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
  
          //Push notifications
          Parse.initialize(this, "nSXPAwYG29VZMdfsddfsdfsdfdselz", "PWeiawu25r7sAmOYddfdsfsdfsdfssVkSJJEWU");
          PushService.setDefaultPushCallback(this, MainActivity.class);
          ParseAnalytics.trackAppOpened(getIntent());
          // Save the current Installation to Parse.
          ParseInstallation.getCurrentInstallation().saveInBackground();
  
  
          //Remove title bar
          this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  
          //Remove notification bar
          //this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          tHost = (TabHost) findViewById(android.R.id.tabhost);
          tHost.setup();
  
          /** Defining Tab Change Listener event. This is invoked when tab is changed */
          TabHost.OnTabChangeListener tabChangeListener = new TabHost.OnTabChangeListener() {
  
              @Override
              public void onTabChanged(String tabId) {
                  android.support.v4.app.FragmentManager fm =   getSupportFragmentManager();
                  HomeFragment homeFragment = (HomeFragment) fm.findFragmentByTag("outdeh");
                  EventsFragment eventsFragment = (EventsFragment) fm.findFragmentByTag("events");
                  PicsFragment picsFragment = (PicsFragment) fm.findFragmentByTag("pics");
                  NewsFragment newsFragment = (NewsFragment) fm.findFragmentByTag("news");
                  android.support.v4.app.FragmentTransaction ft = fm.beginTransaction();
  
                  /** Detaches the homeFragment if exists */
                  if(homeFragment!=null)
                      ft.detach(homeFragment);
  
                  /** Detaches the eventsFragment if exists*/
                   if(eventsFragment!=null)
                   ft.detach(eventsFragment);
  
                  /** Detaches the newsFragment if exists */
                  if(newsFragment!=null)
                      ft.detach(newsFragment);
  
                  /** Detaches the picsFragment if exists */
                  if(picsFragment!=null)
                      ft.detach(picsFragment);
  
  
                  /** If current tab is android */
                  if(tabId.equalsIgnoreCase("outdeh")){
  
                      if(homeFragment==null){
                          /** Create homeFragment and adding to fragmenttransaction */
                          ft.add(R.id.realtabcontent,new HomeFragment(), "outdeh");
                      }else{
                          /** Bring to the front, if already exists in the fragmenttransaction */
                          ft.attach(homeFragment);
                      }
  
                  }else if(tabId.equalsIgnoreCase("events")){
  
                      if(eventsFragment==null){
                          /** Create homeFragment and adding to fragmenttransaction */
                          ft.add(R.id.realtabcontent,new EventsFragment(), "events");
                      }else{
                          /** Bring to the front, if already exists in the fragmenttransaction */
                          ft.attach(eventsFragment);
                      }
  
                  }else if(tabId.equalsIgnoreCase("news")){
  
                      if(newsFragment==null){
                          /** Create homeFragment and adding to fragmenttransaction */
                          ft.add(R.id.realtabcontent,new NewsFragment(), "news");
                      }else{
                          /** Bring to the front, if already exists in the fragmenttransaction */
                          ft.attach(newsFragment);
                      }
  
                  }else if(tabId.equalsIgnoreCase("pics")){
  
                      if(picsFragment==null){
                          /** Create homeFragment and adding to fragmenttransaction */
                          ft.add(R.id.realtabcontent,new PicsFragment(), "pics");
                      }else{
                          /** Bring to the front, if already exists in the fragmenttransaction */
                          ft.attach(picsFragment);
                      }
  
                  }
                  ft.commit();
              }
          };
  
  
          /** Setting tabchangelistener for the tab */
          tHost.setOnTabChangedListener(tabChangeListener);
  
          /** Defining tab builder for Home tab */
          TabHost.TabSpec tSpecOutdeh = tHost.newTabSpec("outdeh");
          tSpecOutdeh.setIndicator("OutDeh",getResources().getDrawable(R.drawable.home));
          tSpecOutdeh.setContent(new DefinedTabContent(getBaseContext()));
          tHost.addTab(tSpecOutdeh);
  
  
          /** Defining tab builder for Events tab */
          TabHost.TabSpec tSpecEvents = tHost.newTabSpec("events");
          tSpecEvents.setIndicator("Upcoming Events",getResources().getDrawable(R.drawable.events));
          tSpecEvents.setContent(new DefinedTabContent(getBaseContext()));
          tHost.addTab(tSpecEvents);
  
          /** Defining tab builder for Pics tab */
          TabHost.TabSpec tSpecPics = tHost.newTabSpec("pics");
          tSpecPics.setIndicator("Recent Event Pictures",getResources().getDrawable(R.drawable.pics));
          tSpecPics.setContent(new DefinedTabContent(getBaseContext()));
          tHost.addTab(tSpecPics);
  
          /** Defining tab builder for News tab */
          TabHost.TabSpec tSpecNews = tHost.newTabSpec("news");
          tSpecNews.setIndicator("Entertainment News",getResources().getDrawable(R.drawable.news));
          tSpecNews.setContent(new DefinedTabContent(getBaseContext()));
          tHost.addTab(tSpecNews);
  
      }
  
  }
  </code></pre>
  
  <p>//Next Class Below</p>
  
  <hr>
  
  <p>When I run this, I get the following error.</p>
  
  <pre><code>inconvertible types
  found   : android.support.v4.app.Fragment
  required: com.outdeh.EventsFragment
  
  
  detach(android.support.v4.app.Fragment) in android.support.v4.app.FragmentTransaction cannot be applied to (com.outdeh.EventsFragment)
  
  cannot find symbol method add(int,com.outdeh.EventsFragment,java.lang.String)
  
  attach(android.support.v4.app.Fragment) in android.support.v4.app.FragmentTransaction cannot be applied to (com.outdeh.EventsFragment)
  </code></pre>