Why does MainActivity inherit from ActionBarActivity?

0

I'm creating a new project and my Activity appears as ActionBarActivity:

public class MainActivity extends ActionBarActivity 

Does anyone know why or how to fix it?

    
asked by anonymous 10.05.2014 / 20:04

1 answer

4

In fact, there is no problem inheriting from ActionBarActivity . ActionBarActivity is a superclass included in support library v7 ( android-support- v7-appcompat ).

Using this library, your app will have access to many features (% w / o% eg in Android 11) that are not included in the default SDK at certain levels.

If your app has an SDK of at least 11, or you do not need to use ActionBar , then you can switch to ActionBar with no problems.

In short: Inheriting Activity does not cause any problems, only adds more functionality to your ActionBarActivity . If you are having problems in use, that is, the compiler does not find the class, so you need to import the library, as I do not know your IDE, I recommend looking at that support-library-setup .

If you have another problem, I suggest posting the error it generates.

    
11.05.2014 / 03:47