Why does Mainactivity inherit from Actionbaractivity?

Asked

Viewed 125 times

0

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

public class MainActivity extends ActionBarActivity 

someone knows why or how to tidy up?

1 answer

4

Actually, there’s no problem in inheriting from the class ActionBarActivity. To ActionBarActivity is a superclass included in the v7 support library (android-support-v7-appcompat).

Using this library, your app will have access to many features (O ActionBar for example, appeared on Android 11) which are not included in the standard SDK at certain levels.

If your app has a minimum SDK of 11, or you don’t need to use the ActionBar, then you can trade for Activity hassle-free.

In short: To inherit ActionBarActivity does not cause any problems, just adds more functionality to your Activity. If you are having trouble using, 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 this support-library-setup.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.