Like this:
val myString = getString(string.hello_from_vb_activity)
Not like this:
val myString = getString(R.string.hello_from_vb_activity)
CodePudding user response:
import com.android.example.viewbindingsample.R.string
//import yourPackageName.R.string
you can import string like this then it will look as you expect
By the way this does same job.
R.string.any_string
string.any_string
in both case you are using R class