Issue
Like this:
val myString = getString(string.hello_from_vb_activity)
Not like this:
val myString = getString(R.string.hello_from_vb_activity)
Solution
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
Answered By - Ankita Patel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.