title: Progress bar and No internet connection in webview Fragment
body: <p>I am trying to get a progress bar which shows until the web page is loaded. and if user has no internet connection than a text or toast is showed... but i am unable to get it worked.. searched the whole website. i think its easy to add progress bar  to class that expends Activity...
  here is my class and layout</p>
  
  <pre><code>package com.nirav.rpta.fragments;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import com.nirav.rpta.R;
  public class OneFragment extends Fragment{
  
  public OneFragment() {
      // Required empty public constructor
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View rootView = inflater.inflate(R.layout.fragment_one, container, false);
      WebView heroespage = (WebView) rootView.findViewById(R.id.webview);
      WebSettings webSettings = heroespage.getSettings();
      webSettings.setJavaScriptEnabled(true);
      heroespage.loadUrl("http://google.co.in/");
  
      return rootView;
  }}
  </code></pre>
  
  <p>and my layout</p>
  
  <pre><code>&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"
  tools:context="com.nirav.rpta.fragments.OneFragment"&gt;
  &lt;WebView
  android:id="@+id/webview"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
      android:orientation="vertical"
  /&gt;&lt;/RelativeLayout&gt;
  </code></pre>