Guest User

Untitled

a guest
Oct 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. class MVVMFragment : Fragment() {
  2.  
  3. companion object {
  4. fun newInstance() = MVVMFragment()
  5. }
  6.  
  7. private lateinit var viewModel: MVVMViewModel
  8.  
  9. override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
  10. savedInstanceState: Bundle?): View? {
  11. return inflater.inflate(R.layout.mvvm_fragment, container, false)
  12. }
  13.  
  14. override fun onActivityCreated(savedInstanceState: Bundle?) {
  15. super.onActivityCreated(savedInstanceState)
  16. viewModel = ViewModelProviders.of(this).get(MVVMViewModel::class.java)
  17. // TODO: Use the ViewModel
  18. }
  19.  
  20. }
Add Comment
Please, Sign In to add comment