0
votes

I am creating a demo project for sliding tab with material design. When I am doing like below :

public class MainActivity extends ActionBarActivity { // source code}

It will show red line on "ActionBarActivity". It is not allows for extends. I have follow steps from http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html

Any help would be greatly appreciated.

2
Have you imported app compat library properly?Harry's Lab

2 Answers

1
votes

Since the version 22.1.0, the class ActionBarActivity is deprecated. For better approach you should use AppCompatActivity

Just change your dependency,Like :

compile "com.android.support:appcompat-v7:22.1.0"
0
votes

FYI, ActionBarActivity is deprecated but it should not show red lines, that is an error indication probably due to import! Use AppCompatActivity introduced in support V7 library.