Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.support.v7.app.ActionBarActivity is deprecated

Tags:

android

android.support.v7.app.ActionBarActivity is deprecated, what does this mean and how do i solve ths issue. I am new to coding.

Also public class MainActivity extends ActionBarActivity. the word "ActionBarActivity" has a line across the word , why is this ?

Regards

CC

like image 956
CAC Avatar asked May 21 '15 19:05

CAC


3 Answers

This version worked for me:

import androidx.appcompat.app.AppCompatActivity;

public class BaseActivity extends AppCompatActivity {
}
like image 184
Alex Mo Avatar answered Sep 22 '22 16:09

Alex Mo


Use

android.support.v7.app.AppCompatActivity

instead of

android.support.v7.app.ActionBarActivity (DEPRECATED)

and extends AppCompatActivity

    public myClass extends AppCompatActivity{
...
...

if you have the message:

cannot resolve symbol AppCompatActivity

You have to update to the last support library in your Android SDK Manager

like image 35
Jorgesys Avatar answered Sep 25 '22 16:09

Jorgesys


The line across ActionBarActivity means that it has been deprecated. Its just another way of denoting it. You should now use AppCompatActivity instead starting with version 22.1.0.

You can read more here.

like image 32
Dikshant Adhikari Avatar answered Sep 22 '22 16:09

Dikshant Adhikari