'Data not visible
- My Variable Class
data class QnaVariable( val questionOne: String, val answerOne : String, val questionTwo: String, val answerTwo : String)
- My ViewModel Class
val item = QnaVariable("I am unable to login my account",
"You can reset password using the Reset Password in My account Page. If you are still unable to access your account, then please call our customer care.",
"Still need help?",
"Have a queries? please get in touch and we will be happy to help you")
}
- My Fragment Class
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = FragmentQuestionAnswerBinding.inflate(layoutInflater, container, false)
val model = viewModel.item
//binding.questionHeading1.text = model.toString()
binding.questionHeading1.text = QNAdapter(myList).toString()
return binding.root
}
}
Solution 1:[1]
return FragmentQuestionAnswerBinding.inflate(layoutInflater, container, false).apply {
binding = this
//TODO: write code to update your ui
}.root
Modify binding part like this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PJH |