title: ActionBarActivity and FragmentActivity... "Inconvertible types"?
body: <p>I'm currently having a curious problem, trying to use simultaneously v4 and v7 (actionbar) compatibility libs.</p>
  
  <p>Let's say I've got my own Activity class, that extends ActionBarActivity on one hand and, on the other hand a Fragment, inside of which I call "(MyActivity)getActivity()".</p>
  
  <p>I checked the imports and my Fragment is a v4 Fragment.</p>
  
  <p>In a v4 Fragment, calling "getActivity()" returns a FragmentActivity.</p>
  
  <p>I also checked: ActionBarActivity extends FragmentActivity.</p>
  
  <p>Now here is my problem:
  I don't have any error in the editor (no red line).
  I'm using Android Studio.
  When I try to "Make" the project, the compiler returns an error for each time I call "getActivity" inside my Fragment.
  It tells me he has a FragmentActivity but a ActionBarActivity is expected and tells me those classes are incompatible.
  It interrupts and I can't even test my app.</p>
  
  <p>It may be a problem with the gradle configuration, but I added "compile "compile "com.android.support:appcompat-v7:18.0.+""  in the "dependencies" part of my build.gradle file, as said on this page:"<a href="http://developer.android.com/tools/support-library/setup.html" rel="nofollow">http://developer.android.com/tools/support-library/setup.html</a>", and it doesn't change anything...</p>
  
  <p>Any idea?</p>
  
  <p><strong>EDIT :</strong>
  As an adddition to my yesterday's post, even if everything is explain before, here are some code parts and the error message Android-Studio gives me:</p>
  
  <p>First of all, my activity:</p>
  
  <pre><code>...
  import android.support.v7.app.ActionBarActivity;
  ...
  public abstract class MyAbstractActivity extends ActionBarActivity{
      //Do some stuff here
  }
  </code></pre>
  
  <p>Every activity of my application extends this class.</p>
  
  <p>Now here is my fragment:</p>
  
  <pre><code>...
  import android.support.v4.app.Fragment;
  import android.support.v7.app.ActionBar;
  ...
  public class MyFragment extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          //Do some stuff...
          ((MyAbstractActivity)getActivity()).getSupportActionBar().setTitle(R.string.app_name);
      }
  
      //Do some stuff...
  }
  </code></pre>
  
  <p>No error is shown in the editor.
  But when I "Make" the project, I get this message in the "Event Log":</p>
  
  <blockquote>
    <p>Compilation completed with 5 errors and 0 warnings in 4 sec</p>
  </blockquote>
  
  <p>In the "Messages Make" part, I can see this for each time I try to cast "getActvity()" in "MyAbstractActivity":</p>
  
  <blockquote>
    <p>java: inconvertible types
    required: com.myapps.abstracts.MyAbstractActivity
    found: android.support.v4.app.FragmentActivity</p>
  </blockquote>