Your MainActivity
is a kind of Activity
, but the activity is not an ActionBar
. It may have an ActionBar
or make use of one, but it is not an ActionBar
. Therefore, trying to get the MainActivity
class to extend ActionBar
is the wrong concept.
I'm not sure what you want to do (I personally haven't tried using the ActionBar
class directly). If you just want your activity to do stuff with the action bar, just declare a variable of type ActionBar
:
ActionBar actionBar;
and assign it to getActionBar()
or getSupportActionBar()
when you need it. If you really want to add functionality to the ActionBar
provided by Android, maybe you could define a class that extends ActionBar
, but I don't know how you'd tell Android to use your new class for the action bar it sets up. See this tutorial.
EDIT: After I posted this answer, the question was edited, so that your class now extends ActionBarActivity
:
public class MainActivity extends ActionBarActivity, Activity implements TabListener, OnClickListener
That's different. However, ActionBarActivity
already extends Activity
, therefore you don't need to put Activity
in the above class definition. It will automatically extend Activity
.