title: Error inflating class fragment. Must specify unique android:id, android:tag, or have a parent with an id
body: <p>I am trying to run a fragment but my application keeps on crashing when i run it. I am trying to load the main activity so that i can display the webview in it but i am having no luck.</p>
  
  <p>MainActivity</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  
  public class MainActivity extends FragmentActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  }
  </code></pre>
  
  <p>Fragment code</p>
  
  <pre><code>import android.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  
  public class WebViewFragment extends Fragment {
  
      private WebView mWebView;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_main, container, false);
          mWebView = (WebView) view.findViewById(R.id.webView);
          WebSettings webSettings = mWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          mWebView.loadUrl("https://www.google.co.uk/");
  
          return view;
      }
  }
  </code></pre>
  
  <p>Manifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.bashirsentongo.webviewapp"&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.example.bashirsentongo.webviewapp.MainActivity"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Hello World!" /&gt;
  
      &lt;fragment
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          class="com.example.bashirsentongo.webviewapp.WebViewFragment"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>fragment_main.xml</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="layout.main"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="@string/hello_blank_fragment" /&gt;
  
      &lt;WebView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/webView"/&gt;
      /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>