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 7844327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:50:35+00:00 2026-06-02T16:50:35+00:00

I have created an application for admob, but I am getting an error. I

  • 0

I have created an application for admob, but I am getting an error. I found an example from Google and I have tried it, but there is a problem when I’m launching the application .

I’m using Android 2.2 API 8.
I am able to launch the application, but this block is causing an error.

android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

If I change this to

android:configChanges="keyboard|keyboardHidden"

then I am able to launch the application, but there is an error coming on our add field.

you must have adactivity declare in Android Manfiest.xml with config change

Due to this I am not able to show google adds in our application.

Please help me to fix this.

  • 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-02T16:50:36+00:00Added an answer on June 2, 2026 at 4:50 pm
     - AdActivity.java
    
    package com.android.ads;
    
    import android.app.Activity;
    import android.os.Bundle;
    
    import com.google.ads.AdRequest;
    import com.google.ads.AdView;
    
    public class AdsActivity extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
    
            AdView adview = (AdView) findViewById(R.id.adView);
            AdRequest re = new AdRequest();
            re.setTesting(true);
            re.setGender(AdRequest.Gender.FEMALE);
            adview.loadAd(re);
        }
    }
    
     - main.xml
    
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    
            xmlns:ads="http://schemas.android.com/apk/res/com.android.ads"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/hello" />
    
         <com.google.ads.AdView
            android:id="@+id/adView"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            ads:adSize="BANNER"
            ads:adUnitId="Your adunit ID" 
            android:layout_alignParentBottom="true"/>    
    </LinearLayout>
    
    Remember Put GoogleMapAdmobSdk.jar after creating libs folder for Configure build path 
    
    
    Create the attrs.xml in the Values folder
    
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
      <declare-styleable name="com.google.ads.AdView">
          <attr name="adSize">
              <enum name="BANNER" value="1"/>
              <enum name="IAB_MRECT" value="2"/>
              <enum name="IAB_BANNER" value="3"/>
              <enum name="IAB_LEADERBOARD" value="4"/>
          </attr>
          <attr name="adUnitId" format="string"/>
      </declare-styleable>
    </resources>
    
     - AndroidManifest
    
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.android.ads"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk android:minSdkVersion="8" />
     <uses-permission android:name="android.permission.INTERNET"/>
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:name=".AdsActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    
    
            <activity android:name="com.google.ads.AdActivity"
                          android:configChanges="keyboard|keyboardHidden|orientation"/>
        </application>
    
    </manifest>
    
    
    Your work is done buddy............
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an application using Adobe Flex. I took all the files from
I have created an application where i am fetching some data from a webservice,which
I have created an application which inserts data into a SQL database. Basically, from
I have created one application which is reading outlook mail, but when user install
I have created desktop application wherein there are three projects include. any one can
I have created application and implemented ELMAH logging. In my site there are three
i have created an application but now i have added some other views in
I have created android application that uses Google Maps, ans it works fine here
I have created iPad application which downloads images using web service. But my application
I have created application where i just need to access data form assets folder.

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.