Yagnesh Lashkari
Yagnesh Lashkari

Reputation: 247

'java.lang.String' is deprecated in Android

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?

Upvotes: 7

Views: 3477

Answers (1)

Pratik Butani
Pratik Butani

Reputation: 62421

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.

Upvotes: 3

Related Questions