-1

I’m trying to move from one fragment to another fragment on button click and I have watched tutorials on YouTube using ViewBinding to perform this action. But each time I try, it just doesn’t seem to work. I have added the “build features{ ViewBinding true “ in my Gradle (module:app) file and each time I run my app, my app crashes with the error “unknown host: ‘dl.google.com’”

PS: findViewById doesn’t work in fragments

I have spent weeks trying to figure this out. Can someone pls help me out?

Thanks in Advance

Nkay
  • 3
  • 3

1 Answers1

0

Moving from one fragment to another can be easily achieved using Navigation component. I would suggest taking a look at this link as a starting point:

https://developer.android.com/guide/navigation/navigation-getting-started

  • I wanted to test it on my project before commenting. Your response solved a problem that I have been trying to figure out for weeks . I was also able to learn something new because of you. Thanks a lot. – Nkay Mar 28 '22 at 14:56
  • Great. You can can mark my answer as accepted if you found It useful. – Roberto Fortunato Mar 30 '22 at 05:45