Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'java.lang.String' is deprecated in Android Studio [duplicate]

I have write simple TAG like this:

private static final String TAG = "MainActivity"; 

String is deprecated

IDE screenshot showing strikethrough through String

Is there any alternative way available to use String?

like image 534
Yagnesh Lashkari Avatar asked May 31 '19 12:05

Yagnesh Lashkari


1 Answers

As per comment in this java-lang-string-is-deprecated-in-android-studio question,

Remove folder .AndroidStudioX.X in your User folder and Restart IDE.

NOTE: AndroidStudioX.X means if you are using Android Studio version 3.4 then .AndroidStudio3.4 will be there.

Path will be like Windows : C:\Users\<PCNAME>\.AndroidStudio3.4

Linux/Ubuntu : /home/yourname/.AndroidStudio3.4

Hope it will be helpful to you.

like image 178
Pratik Butani Avatar answered Oct 04 '22 00:10

Pratik Butani