0

I am working on a project for my Android dev class, where we have to make use of fragments to create a simple web browser.

Here is my code so far. I have one fragment for the address bar and buttons, and another for the webview widget.

It has been throwing an error that there is no view assigned to the id of my fragment (whichever is first in the fragment transaction). I'm still not great with fragments, views, etc and have been pulling my hair out for days over this one. Based on my Google results so far, it seems like this error can apply to a lot of different scenarios.

I understand that there is still a lot missing from my code, but I'm just focused on the view assignment issue for now.

hunsbct
  • 31
  • 7
  • You should have posted your code here, as text. The problem seems to be that your fragments IDs are `fragment_content` and `fragment_controls` and you're trying to access them using `R.id.Content` and `R.id.Controls`. It should be `fragmentTransaction.add(R.id.fragment_content);` and `fragmentTransaction.add(R.id.fragment_controls); ` – Titus Nov 13 '16 at 17:19
  • Oh my god that fixed it, I can't thank you enough. I'll definitely post the code as text in the future. – hunsbct Nov 13 '16 at 17:50
  • I'm glad I could help, good luck. – Titus Nov 13 '16 at 18:15

0 Answers0