Home » Android » android – How to use R.string.unknownName?-Exceptionshub

android – How to use R.string.unknownName?-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

How to use the R.string.unknownName?

when I use it in MyActivity.getString(R.sting.unknownName) ,it complains

Can’t resolve symbol ‘unknownName’

If I use it in com.android.internal.R.string.unknownName, it complains

Can not resolve symbol R

refer to
https://developer.android.com/reference/kotlin/android/R.string#unknownname**

How to&Answers:

I find the answer. The correct name is
android.R.string.unknownName.