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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:46:33+00:00 2026-06-06T02:46:33+00:00

My Android application was working in English and I have to provide the users

  • 0

My Android application was working in English and I have to provide the users with an Arabic version too. I did the following,

  1. Added a layout-ar folder and put my layout files there.
  2. Added a drawable-ar folder and put my images there.
  3. Added a values-ar folder and translated my string resources in strings.xml
  4. Changed the language settings in my emulator to Arabic for testing

Although the English version of my app was working fine, my Arabic version now crashes with the following log trace

06-20 10:08:13.153: E/AndroidRuntime(623): FATAL EXCEPTION: main
06-20 10:08:13.153: E/AndroidRuntime(623): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.digitalhealthagency.elaj.gui/org.digitalhealthagency.elaj.gui.SplashScreen}: android.view.InflateException: Binary XML file line #7: Error inflating class android.widget.ImageView
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.os.Looper.loop(Looper.java:137)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread.main(ActivityThread.java:4424)
06-20 10:08:13.153: E/AndroidRuntime(623):  at java.lang.reflect.Method.invokeNative(Native Method)
06-20 10:08:13.153: E/AndroidRuntime(623):  at java.lang.reflect.Method.invoke(Method.java:511)
06-20 10:08:13.153: E/AndroidRuntime(623):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-20 10:08:13.153: E/AndroidRuntime(623):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-20 10:08:13.153: E/AndroidRuntime(623):  at dalvik.system.NativeStart.main(Native Method)
06-20 10:08:13.153: E/AndroidRuntime(623): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class android.widget.ImageView
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
06-20 10:08:13.153: E/AndroidRuntime(623):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-20 10:08:13.153: E/AndroidRuntime(623):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.Activity.setContentView(Activity.java:1835)
06-20 10:08:13.153: E/AndroidRuntime(623):  at org.digitalhealthagency.elaj.gui.SplashScreen.onCreate(SplashScreen.java:16)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.Activity.performCreate(Activity.java:4465)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
06-20 10:08:13.153: E/AndroidRuntime(623):  ... 11 more
06-20 10:08:13.153: E/AndroidRuntime(623): Caused by: java.lang.reflect.InvocationTargetException
06-20 10:08:13.153: E/AndroidRuntime(623):  at java.lang.reflect.Constructor.constructNative(Native Method)
06-20 10:08:13.153: E/AndroidRuntime(623):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
06-20 10:08:13.153: E/AndroidRuntime(623):  ... 24 more
06-20 10:08:13.153: E/AndroidRuntime(623): Caused by: java.lang.OutOfMemoryError
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.Bitmap.nativeCreate(Native Method)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.content.res.Resources.loadDrawable(Resources.java:1935)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.widget.ImageView.<init>(ImageView.java:119)
06-20 10:08:13.153: E/AndroidRuntime(623):  at android.widget.ImageView.<init>(ImageView.java:109)
06-20 10:08:13.153: E/AndroidRuntime(623):  ... 27 more

The error log refers to line 16 in my SplashScreen java file which sets the content view setContentView(R.layout.splash_screen);

And my splash_screen.xml file is as follows

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/splash_screen"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:src="@drawable/splash_screen" />

</LinearLayout>

This question is quite similar to mine Android: How to track down the origin of a InflateException? but fixing the style is not solving the problem.

Thank you in advance!

EDIT

After reducing the size of the images as suggested by Aleks G, the image loaded normally, but now I am getting a similar error in a different place.

06-20 14:27:22.157: E/AndroidRuntime(623): FATAL EXCEPTION: main
06-20 14:27:22.157: E/AndroidRuntime(623): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.digitalhealthagency.elaj.gui/org.digitalhealthagency.elaj.gui.AppointmentReservationActivity}: android.view.InflateException: Binary XML file line #99: Error inflating class <unknown>
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.os.Looper.loop(Looper.java:137)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread.main(ActivityThread.java:4424)
06-20 14:27:22.157: E/AndroidRuntime(623):  at java.lang.reflect.Method.invokeNative(Native Method)
06-20 14:27:22.157: E/AndroidRuntime(623):  at java.lang.reflect.Method.invoke(Method.java:511)
06-20 14:27:22.157: E/AndroidRuntime(623):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-20 14:27:22.157: E/AndroidRuntime(623):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-20 14:27:22.157: E/AndroidRuntime(623):  at dalvik.system.NativeStart.main(Native Method)
06-20 14:27:22.157: E/AndroidRuntime(623): Caused by: android.view.InflateException: Binary XML file line #99: Error inflating class <unknown>
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
06-20 14:27:22.157: E/AndroidRuntime(623):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-20 14:27:22.157: E/AndroidRuntime(623):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.Activity.setContentView(Activity.java:1835)
06-20 14:27:22.157: E/AndroidRuntime(623):  at org.digitalhealthagency.elaj.gui.AppointmentReservationActivity.onCreate(AppointmentReservationActivity.java:88)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.Activity.performCreate(Activity.java:4465)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
06-20 14:27:22.157: E/AndroidRuntime(623):  ... 11 more
06-20 14:27:22.157: E/AndroidRuntime(623): Caused by: java.lang.reflect.InvocationTargetException
06-20 14:27:22.157: E/AndroidRuntime(623):  at java.lang.reflect.Constructor.constructNative(Native Method)
06-20 14:27:22.157: E/AndroidRuntime(623):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
06-20 14:27:22.157: E/AndroidRuntime(623):  ... 24 more
06-20 14:27:22.157: E/AndroidRuntime(623): Caused by: java.lang.OutOfMemoryError
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.Bitmap.nativeCreate(Native Method)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.content.res.Resources.loadDrawable(Resources.java:1935)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.content.res.Resources.getDrawable(Resources.java:664)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:867)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.graphics.drawable.Drawable.createFromXml(Drawable.java:804)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.content.res.Resources.loadDrawable(Resources.java:1920)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.view.View.<init>(View.java:2785)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.widget.TextView.<init>(TextView.java:449)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.widget.Button.<init>(Button.java:108)
06-20 14:27:22.157: E/AndroidRuntime(623):  at android.widget.Button.<init>(Button.java:104)
06-20 14:27:22.157: E/AndroidRuntime(623):  ... 27 more

Line 88 that the log trace refers to is

setContentView(R.layout.appointment_reservation);

And line #99 in appointment_reservation.xml is

    <Button android:id="@+id/reserve_button"
        android:text="@string/reserve_button"
        android:layout_width="120dp"
        android:layout_height="40dp"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="20dp"
        android:paddingRight="15dp"
        android:layout_gravity="left"
        style="@style/buttonStyle"
        android:background="@drawable/button_selector" />

I give the button a button_selector xml file which is placed in my drawable folder. The selector switches between two images (total size 6kb).

Thank you in advance!

  • 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-06T02:46:34+00:00Added an answer on June 6, 2026 at 2:46 am

    If you look through to the bottom of the log, you’ll see that the root cause of the problem is:

    Caused by: java.lang.OutOfMemoryError
     at android.graphics.Bitmap.nativeCreate(Native Method)
     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
     at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
     at android.content.res.Resources.loadDrawable(Resources.java:1935)
     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
     at android.widget.ImageView.<init>(ImageView.java:119)
     at android.widget.ImageView.<init>(ImageView.java:109)
     ... 27 more
    

    As this is happening on your splash screen, I’ll make a guess that the Image you’re loading is too large. Compare the image sizes in your English version and your Arabic version to see if the Arabic file is much larger than the English one. Try optimising the image, maybe, scale it down to reduce the size…

    EDIT: On the second error:

    Again, this is an OutOfMemory error. When you have errors like this, always look at the bottom-most Caused by part. In this case you have:

    Caused by: java.lang.OutOfMemoryError
     at android.graphics.Bitmap.nativeCreate(Native Method)
     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
     at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
     at android.content.res.Resources.loadDrawable(Resources.java:1935)
     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
     at android.widget.ImageView.<init>(ImageView.java:119)
     at android.widget.ImageView.<init>(ImageView.java:109)
     ... 27 more
    

    If you have reduced the size of your image, as you indicated, then it means that there’s another large image somewhere.

    Note that it’s not the file size of your JPG or PNG file that matters, it’s how much memory is needed to decode that image file internally. One way to estimate approximately how much memory is required to internally decode an image file is to open that file in an image editor and save it as uncompressed TIFF file. The size of the TIFF file is approximately how much memory decoded image will take in a running Android app. As a test, I just saved a 750KB JPG as a TIFF – and it turned out to be 5.8 MB.

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

Sidebar

Related Questions

I am working on an android application and I added a xml layout file
I am working on a small android application. I have some dynamically added Relative
I am working on Android Application. Now I have requirement of search the entered
I'm working on an android application which allows users to create accounts on a
Hi I am working Android application development using titanium studio.I have developed small application.my
I'm working on my first Android application and I have a pretty good idea
I am working on android application in which i have play online radio streaming.
I am working in android application.I have one doubt How long it takes to
I am working on an Android application and I have a question. I have
I'm working on an Android application. I have an activity that has this method:

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.