Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8176753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:19:08+00:00 2026-06-06T23:19:08+00:00

I have a layout with a webview and admob. I also set orientation|keyboard to

  • 0

I have a layout with a webview and admob. I also set orientation|keyboard to main activity in order handle onConfigChanges in order to not reload page content when device rotation.
When appstarts, webview is created and content loaded, then, admob appears but webview is not auto resized! When happens, I turn device to landscape and return to portrait, layout is resized and properly fitted!
How could I force webview to auto resize again? I tried several options but no succes! thank you

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">


      <com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="xxx"
                         ads:adSize="SMART_BANNER"
                         ads:testDevices="TEST_EMULATOR, xxx"
                         ads:loadAdOnCreate="true"/>    

<RelativeLayout
                    android:id="@+id/bLayout"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_below="@+id/barraSocial">

                    <WebView
                        android:id="@+id/webviewB"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:autoLink="web"
                        android:textColor="@android:color/black" 
                        android:scrollbars="none"
                        />
                </RelativeLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:19:09+00:00Added an answer on June 6, 2026 at 11:19 pm

    Try to force the height of your adview. Somethink like that

    <com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="@dimen/adview_height" />
    

    Where adview_height is the value stored in res/values/dimen.xml, for example:

    <resources>
        <dimen name="adview_height">30dp</dimen>
    </resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity using an xml layout where a WebView is embedded. I
I have a webview pat of my activity layout I have a button fullscreen
I have main tabHost layout that its frame content is set on another layout
I have a Layout containing a fragment. I set width of Layout to let's
What i have here is a simple webview activity that when loaded it auto
I want to add a webview to my layout.But that layout have few other
I have a simple WebView-based activity that follows the Hello, WebView example to enable
I have a webview and an admob ad onthe bottom. It is getting the
In order to implement a navigation bar ala Facebook I have the following layout
I have a webview which is loading a url. If I change the orientation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.