7

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?

11
  • 3
    String is not deprecated it can not probably its a Data Type not just some another class . add your code with question .. Commented May 31, 2019 at 12:09
  • 4
    Wait, what? String is one of the most basic non-primitive data types in Java. Can you show a screenshot of what you're seeing in the IDE? I'm having a hard time believing that. Commented May 31, 2019 at 12:09
  • 3
    It's just some weird IDE problem: 'java.lang.String' is deprecated in Android Studio. Commented May 31, 2019 at 12:11
  • 2
    Wow i have first time hear that a data type can also be depreacate Commented May 31, 2019 at 12:11
  • @MarkusKauppinen That's a really interesting question, shame it hasn't had an answer (and thus we can't flag as duplicate) Commented May 31, 2019 at 12:12

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

5 Comments

AndroidStudioX folder is not available!
AndroidStudioX.X means if you are using Android Studio version 3.4 then AndroidStudio3.4 will be there. Path : C:\Users\<PCNAME>\.AndroidStudio3.4
i have use Ubuntu System how to get this if you know then please tell me
Then path will be /home/yourname/.AndroidStudio3.4
i got this folder and remove using command rm -rf .AndroidStudio3.4 its work! thanks bro

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.