I've been trying out implementing navigation in android through navigation drawers and swipe views with tabs. I've followed Google's developer tutorials (here and here) and for both situations I could never get my code to work unless I changed Activity or FragmentActivity to AppCompatActivity and applied other changes in the action bars code, for instance change getActionBar to getSupportActionBar so I don't get NPE.
Now the questions:
1- Why do I need to make these changes when I'm following official tutorials that should work the way they are?
2 - Is AppCompatActivity correct to use in these cases or is there a better way to do the same thing?
3 - Are these situations related to the min sdk and target sdk I chose? My min sdk is 14 and my target sdk is 22. Should I try to lower the target sdk?
4 - Are these situations related to the style/theme of my application? It's android:theme="@style/AppTheme" > .
Some insight on this subject is appreciated so thank you in advance.
Edit: Another thing I noticed is that I always need to import android.support.v7.app.ActionBar instead of android.app.ActionBar so I don't get NPE, even though my min sdk is higher than API 11.
Edit2: I noticed some contradiction in the developers' guides. Because I want to use ActionBar, I need to get my imports right. Following this link, it's recommended that I include v7 appcompat libraries, but following this one I need to import android.app.ActionBar because my min sdk is higher than 11. Like I said before, using android.app.ActionBar produces NPE, so what should I do?