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

  • Home
  • SEARCH
  • 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 9027575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:46:40+00:00 2026-06-16T06:46:40+00:00

I have programmed a simple app for testing some things. One thing is AdMob.

  • 0

I have programmed a simple app for testing some things.
One thing is AdMob.

On most of the Android Phone it works, but on Galaxy S3 or Galaxy Nexus, or on Tablets not. Maybe there is a Problem with the higher resoltuion?
The problem is that the app closes immediately when it starts. I tried to integrate AdMob on XML, but that does not work with the new version really.

Here is my AdMob Code.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    AdRequest adRequest = new AdRequest();
    adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
    AdView adView = new AdView(this, AdSize.BANNER, "replaced id with this");
    //adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    LinearLayout layout = (LinearLayout)findViewById(R.id.LayoutMain);
    layout.addView(adView,0);   
    adView.loadAd(adRequest);

And here is the LogCat

12-20 18:39:18.056: I/dalvikvm(541):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-20 18:39:18.066: I/dalvikvm(541):   at dalvik.system.NativeStart.main(Native Method)
12-20 18:39:18.086: D/AndroidRuntime(541): Shutting down VM
12-20 18:39:18.096: W/dalvikvm(541): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
12-20 18:39:18.206: E/AndroidRuntime(541): FATAL EXCEPTION: main
12-20 18:39:18.206: E/AndroidRuntime(541): java.lang.RuntimeException: Unable to start activity ComponentInfo{at.android.dertestloerk/at.android.dertestloerk.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.os.Looper.loop(Looper.java:137)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread.main(ActivityThread.java:4340)
12-20 18:39:18.206: E/AndroidRuntime(541):  at java.lang.reflect.Method.invokeNative(Native Method)
12-20 18:39:18.206: E/AndroidRuntime(541):  at java.lang.reflect.Method.invoke(Method.java:511)
12-20 18:39:18.206: E/AndroidRuntime(541):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-20 18:39:18.206: E/AndroidRuntime(541):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-20 18:39:18.206: E/AndroidRuntime(541):  at dalvik.system.NativeStart.main(Native Method)
12-20 18:39:18.206: E/AndroidRuntime(541): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
12-20 18:39:18.206: E/AndroidRuntime(541):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-20 18:39:18.206: E/AndroidRuntime(541):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.Activity.setContentView(Activity.java:1835)
12-20 18:39:18.206: E/AndroidRuntime(541):  at at.android.dertestloerk.MainActivity.onCreate(MainActivity.java:27)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.Activity.performCreate(Activity.java:4465)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
12-20 18:39:18.206: E/AndroidRuntime(541):  ... 11 more
12-20 18:39:18.206: E/AndroidRuntime(541): Caused by: java.lang.reflect.InvocationTargetException
12-20 18:39:18.206: E/AndroidRuntime(541):  at java.lang.reflect.Constructor.constructNative(Native Method)
12-20 18:39:18.206: E/AndroidRuntime(541):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
12-20 18:39:18.206: E/AndroidRuntime(541):  ... 23 more
12-20 18:39:18.206: E/AndroidRuntime(541): Caused by: java.lang.OutOfMemoryError
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.Bitmap.nativeCreate(Native Method)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.content.res.Resources.loadDrawable(Resources.java:1937)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.View.<init>(View.java:2780)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.View.<init>(View.java:2717)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.view.ViewGroup.<init>(ViewGroup.java:379)
12-20 18:39:18.206: E/AndroidRuntime(541):  at android.widget.RelativeLayout.<init>(RelativeLayout.java:174)
12-20 18:39:18.206: E/AndroidRuntime(541):  ... 26 more
12-20 18:39:23.096: I/Process(541): Sending signal. PID: 541 SIG: 9

And here is my XML Layout

<LinearLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LayoutMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/hintergrund"
android:orientation="vertical"
tools:context=".MainActivity" >

<ImageView
    android:id="@+id/imageViewLoerg"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scaleType="fitCenter"
    android:src="@drawable/animatedloerg"
    tools:ignore="ContentDescription" /> </LinearLayout>

Hope you can help .-)

  • 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-16T06:46:41+00:00Added an answer on June 16, 2026 at 6:46 am

    This has nothing to do with Admob. The error is at:

    18:39:18.206: E/AndroidRuntime(541): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout 12-20 18:39:18.206: E/AndroidRuntime(541): at

    Ie it is crashing trying to load the XML layout, long before you programmatically ad in the Admob AdView.

    Look at your layout, there is a problem there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have programmed an emulator, but I have some doubts about how to organizate
I programmed an App for Android and got some trouble with my Service. The
I have programmed a simple app that every X minutes checks if an image
I've programmed Android for a while, but this really puzzles me. So I have
I have programmed a simple hibernate app which isn't updating the table. The following
I have programmed a simple hibernate app which leaves me with errors. The following
I have some pyunit unit tests for a simple command line programme I'm writing.
I have never programmed a gadget for Vista or Seven, but I would like
I need to build an app that works on IPhone , Android and Blackberry
I have programmed a boost::thread application, where I might have some race conditions. I

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.