'java.lang.String' is deprecated in Android

ⅰ亾dé卋堺 提交于 2019-12-30 18:25:35

问题


I have write simple TAG like this:

private static final String TAG = "MainActivity"; 

String is deprecated

Is there any alternative way available to use String?


回答1:


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.



来源:https://stackoverflow.com/questions/44402476/java-lang-string-is-deprecated-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!