title: How show Banner Ads on Newspaper Webview Android Eclipse
body: <p>How show Banner Ads on Newspaper Link "Webview" Android Eclipse
  I already set Admob "Banner Ads and Interstitial Ads" on my Project. Interstitial Ads Work Correctly but Banner Ads not Show on Webview. <br>
  <strong>Here my Java &amp; xml Code</strong> <br><br>
  <strong>Details_Newspaper.Java</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.nasir.newspaper;
  
  import android.annotation.SuppressLint;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.ViewConfiguration;
  import android.view.Window;
  import android.webkit.WebChromeClient;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.Toast;
  
  import com.google.android.gms.ads.AdListener;
  import com.google.android.gms.ads.AdRequest;
  import com.google.android.gms.ads.AdView;
  import com.google.android.gms.ads.InterstitialAd;
  
  @SuppressLint("SetJavaScriptEnabled")
  public class Details_Newapaper extends Activity {
  
   WebView mWebview;
   
   AdView mAdView;
   private InterstitialAd interAd;
  
   @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Adds Progrss bar Support
    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.details_newapaper );
    
    // For Banner Ads View
          AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);
    
    // For Interstitial Ads View
    interAd = new InterstitialAd(this);
    interAd.setAdUnitId("ca-app-pub-3940256099942544/1033173712");
    
    AdRequest adRequest_FC = new AdRequest.Builder().build();
    interAd.loadAd(adRequest_FC);
    interAd.setAdListener(new AdListener() {
     
     @Override
     public void onAdLoaded() {
      // TODO Auto-generated method stub
      displayInterstitial();
     }
    });
    
    getOverflowMenu();
      
    // Makes Progress bar Visible
    getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); 
      
    mWebview = new WebView(this);
  
    mWebview.getSettings().setJavaScriptEnabled(true); // enable javascript
    mWebview.getSettings().setSupportZoom(true);  //Zoom Control on web (You don't need this 
                  //if ROM supports Multi-Touch  
    mWebview.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM
    
    
    final Activity Activity = this;
    
    mWebview.setWebChromeClient(new WebChromeClient() {
           public void onProgressChanged(WebView view, int progress)   
           {
            //Make the bar disappear after URL is loaded, and changes string to Loading...
            Activity.setTitle("Loading..... Please Wait");
            Activity.setProgress(progress * 100); //Make the bar disappear after URL is loaded
            
            // Return the app name after finish loading
               if(progress == 100)
                Activity.setTitle(R.string.app_name);
             }
           });
  
    mWebview.setWebViewClient(new WebViewClient() {
     public void onReceivedError(WebView view, int errorCode,
       String description, String failingUrl) {
      Toast.makeText(Activity, description, Toast.LENGTH_SHORT).show();
     }
    });
  
    String customHtml = getIntent().getStringExtra("Newspaper_Name");
    mWebview.loadUrl(customHtml);
    setContentView(mWebview);
    mWebview.getSettings().setBuiltInZoomControls(true);
  
   }
   
   
  //  On Back Button Press, Go to Website Back
   @Override
   public void onBackPressed() {
    if (mWebview.isFocused() &amp;&amp; mWebview.canGoBack()) {
     mWebview.goBack();
    } else {
     super.onBackPressed();
     finish();
    }
   }
   
   
   
   
   
   // For Interstitial Ads View 
   public void displayInterstitial() {
    
    if (interAd.isLoaded()) {
     interAd.show();
     
    }
   }
  
      /** Called when leaving the activity */
      @Override
      public void onPause() {
          if (mAdView != null) {
              mAdView.pause();
          }
          super.onPause();
      }
  
      /** Called when returning to the activity */
      @Override
      public void onResume() {
          super.onResume();
          if (mAdView != null) {
              mAdView.resume();
          }
      }
  
      /** Called before the activity is destroyed */
      @Override
      public void onDestroy() {
          if (mAdView != null) {
              mAdView.destroy();
          }
          super.onDestroy();
      }
      
      
      
      
      
      
   
   // inflate for action bar
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.refresh_main, menu);
          return true;
      }
   
      // handle click events for action bar items
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
   
          switch (item.getItemId()) {
   
              case R.id.refresh:
                  showToast("Refresh was clicked.");
                  return true;
   
              
   
  //            case R.id.share:
  //                showToast("Share was clicked.");
  //                return true;
  // 
              default:
                  return super.onOptionsItemSelected(item);
          }
      }
   
      // put the other two menu on the three dots (overflow)
      private void getOverflowMenu() {
   
          try {
   
             ViewConfiguration config = ViewConfiguration.get(this);
             java.lang.reflect.Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
             if(menuKeyField != null) {
                 menuKeyField.setAccessible(true);
                 menuKeyField.setBoolean(config, false);
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
   
       }
   
      // so that we know something was triggered
      public void showToast(String msg){
          Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
      }
   
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>details_newspaper.xml</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="top|fill_vertical"
      android:orientation="vertical"
      tools:context=".MainActivity" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;WebView
              android:id="@+id/webView1"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent" /&gt;
         
      &lt;/LinearLayout&gt;
  
      &lt;com.google.android.gms.ads.AdView
          android:id="@+id/adView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          ads:adSize="BANNER"
          ads:adUnitId="ca-app-pub-1528948212400372/9325301249" &gt;
      &lt;/com.google.android.gms.ads.AdView&gt;
  
  &lt;/RelativeLayout&gt;</code></pre>
  </div>
  </div>
  </p>