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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:49:55+00:00 2026-05-22T20:49:55+00:00

I have used three images in layout where two are set in layout and

  • 0

I have used three images in layout where two are set in layout and one load from drawable at runtime. In 2.1, 2.3, 3.0, 3.1 it works fine but I am getting an error with 2.2 and 2.3.3.

Here is my XML file.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout android:id="@+id/TopBar"
    android:layout_alignParentTop="true" android:layout_above="@+id/BottomBar"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <LinearLayout android:id="@+id/ClientSide"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_alignParentTop="true" android:layout_marginTop="5dip"
        android:orientation="vertical" android:layout_alignParentLeft="true"
        android:background="#00000000">
        <TextView android:id="@+id/EnterName" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="@string/enterclientname"
            android:textColor="#FFFFFF" android:textSize="22sp"
            android:textStyle="bold" android:layout_marginLeft="3dip">
        </TextView>
        <TextView android:id="@+id/Date" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="@string/date"
            android:textColor="#FFFFFF" android:textSize="10sp"
            android:textStyle="bold" android:layout_marginLeft="3dip">
        </TextView>
    </LinearLayout>
    <LinearLayout android:id="@+id/ServerSide"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_alignParentTop="true" android:layout_marginTop="5dip"
        android:orientation="vertical" android:layout_alignParentRight="true"
        android:background="#00000000">
        <TextView android:id="@+id/ProvidedBy" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="@string/providedby"
            android:textColor="#FFFFFF" android:textSize="10sp"
            android:textStyle="bold" android:layout_marginRight="3dip">
        </TextView>
        <TextView android:id="@+id/CenterName" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="@string/centername"
            android:textColor="#FFFFFF" android:textSize="10sp"
            android:textStyle="bold" android:layout_marginRight="3dip">
        </TextView>
        <TextView android:id="@+id/CenterAddress"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:text="@string/centeraddress" android:textColor="#FFFFFF"
            android:textSize="10sp" android:textStyle="bold"
            android:layout_marginRight="3dip">
        </TextView>
    </LinearLayout>
    <ImageView android:id="@+id/PersonAura"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:src="@drawable/person" android:scaleType="fitXY"
        android:adjustViewBounds="true" android:layout_centerInParent="true" />
    <ImageView android:id="@+id/OuterAura" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:src="@drawable/outeraura"
        android:scaleType="fitXY" android:adjustViewBounds="true"
        android:layout_centerInParent="true" />
    <ImageView android:id="@+id/InnerAura" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:scaleType="fitXY"
        android:adjustViewBounds="true" android:layout_centerInParent="true" />
</RelativeLayout>
<LinearLayout android:id="@+id/BottomBar"
    android:layout_alignParentBottom="true" android:gravity="center"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:background="@drawable/bar" android:layout_centerVertical="true">
    <Button android:id="@+id/Scan" android:layout_width="wrap_content"
        android:layout_height="wrap_content" style="@style/Button"
        android:textSize="13sp" android:text="@string/scan"
        android:textColor="#FFFFFF" android:textStyle="bold"
        android:layout_weight="1" android:layout_marginLeft="1dip">
    </Button>
    <Button android:id="@+id/Tune" android:layout_width="wrap_content"
        android:layout_height="wrap_content" style="@style/Button"
        android:textSize="13sp" android:text="@string/tune"
        android:textColor="#FFFFFF" android:textStyle="bold"
        android:layout_weight="1" android:layout_marginLeft="1dip"
        android:layout_marginRight="1dip">
    </Button>
    <Button android:id="@+id/Save" android:layout_width="wrap_content"
        android:layout_height="wrap_content" style="@style/Button"
        android:textSize="13sp" android:text="@string/saveb"
        android:textColor="#FFFFFF" android:textStyle="bold"
        android:layout_weight="1" android:layout_marginLeft="1dip"
        android:layout_marginRight="1dip">
    </Button>
    <Button android:id="@+id/Share" android:layout_width="wrap_content"
        android:layout_height="wrap_content" style="@style/Button"
        android:textSize="13sp" android:text="@string/share"
        android:textColor="#FFFFFF" android:textStyle="bold"
        android:layout_weight="1" android:layout_marginLeft="1dip"
        android:layout_marginRight="1dip">
    </Button>
    <Button android:id="@+id/Settings" android:layout_width="wrap_content"
        android:layout_height="wrap_content" style="@style/Button"
        android:textSize="13sp" android:text="@string/settings"
        android:textColor="#FFFFFF" android:textStyle="bold"
        android:layout_weight="1" android:layout_marginRight="1dip">
    </Button>
</LinearLayout>
</RelativeLayout>

And here is my Java file.

public class Aura extends Activity 
{
protected static final String TAG = "TAG";

TextView mClientName, mDate, mProvidedBy, mCenterName, mCenterAddress;
ImageView mOutterAuraImage, mInnerAuraImage, mPersonAuraImage;
String mGetClientNameString;
Button mScan, mTune, mSave, mShare, mSettings;
EditText mSavedClientName;

Bitmap mBackImage, mTopImage, mBackground, mInnerImage, mNewSaving;
Bitmap mTopModifiedImage, mNewKetanImage, mSaveTakeViewBitmap, mTakeViewBitmap;
Canvas mComboImage;
FileOutputStream mFileOutputStream;
BitmapDrawable mBitmapDrawable, mTakeViewBitmapDrawable;
boolean mFileSendSet = false, mFirstSaveCalled = false;
float mContrast;
private ColorMatrix mColorMatrix;
Drawable mDrawable;

@Override
public void onCreate(Bundle mSavedInstanceState) 
{
    super.onCreate(mSavedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.aura);

    Log.v(TAG, "Brand: " + android.os.Build.BRAND);
    Log.v(TAG, "Device: " + android.os.Build.DEVICE);
    Log.v(TAG, "Display: " + android.os.Build.DISPLAY);
    Log.v(TAG, "ID: " + android.os.Build.ID);
    Log.v(TAG, "Model: " + android.os.Build.MODEL);
    Log.v(TAG, "Manufacturer: " + android.os.Build.MANUFACTURER);

    mClientName = (TextView) findViewById(R.id.EnterName);
    mDate = (TextView) findViewById(R.id.Date);
    mProvidedBy = (TextView) findViewById(R.id.ProvidedBy);
    mCenterName = (TextView) findViewById(R.id.CenterName);
    mCenterAddress = (TextView) findViewById(R.id.CenterAddress);
    mScan = (Button) findViewById(R.id.Scan);
    mTune = (Button) findViewById(R.id.Tune);
    mSave = (Button) findViewById(R.id.Save);
    mShare = (Button) findViewById(R.id.Share);
    mSettings = (Button) findViewById(R.id.Settings);
    mOutterAuraImage = (ImageView) this.findViewById(R.id.OuterAura);
    mInnerAuraImage = (ImageView) this.findViewById(R.id.InnerAura);
    mPersonAuraImage = (ImageView) this.findViewById(R.id.PersonAura);
    mShare.setOnClickListener(new View.OnClickListener() 
    {
        public void onClick(View mView) 
        {
            try
            {
                Random mRandomGenerator = new Random();

                int mInnerGeneratedRandom = mRandomGenerator.nextInt(255);
                Log.v(TAG, "mInnerGeneratedRandom" + mInnerGeneratedRandom);
                mColorMatrix = new ColorMatrix();

                Drawable mDrawable = getResources().getDrawable(R.drawable.heart);
                mDrawable.setColorFilter( Color.MAGENTA, Mode.MULTIPLY );
                mInnerAuraImage.setImageDrawable(mDrawable);

                int mOutterGeneratedRandom = mRandomGenerator.nextInt(255);
                Log.v(TAG, "mOutterGeneratedRandom" + mOutterGeneratedRandom);
                mContrast = mOutterGeneratedRandom / 180.f;
                setContrastScaleOnly(mColorMatrix, mContrast);
                mOutterAuraImage.setColorFilter(new ColorMatrixColorFilter(mColorMatrix));

                int mPersonGeneratedRandom = mRandomGenerator.nextInt(255);
                Log.v(TAG, "mPersonGeneratedRandom" + mPersonGeneratedRandom);
                mContrast = mPersonGeneratedRandom / 180.f;
                setContrast(mColorMatrix, mContrast);
                mPersonAuraImage.setColorFilter(new ColorMatrixColorFilter(mColorMatrix));
            }
            catch(OutOfMemoryError eOutOfMemoryError)
            {
                Log.v(TAG, "OutOfMemoryError: " + eOutOfMemoryError.toString());
                System.gc();
                //((BitmapDrawable)mInnerAuraImage.getDrawable()).getBitmap().recycle();
                unbindDrawables(mDrawable);
            }
        }
    });
}// onCreate

private void unbindDrawables(Drawable nDrawable) 
{
    if(mDrawable != null)
    {
        mDrawable.setCallback(null);
    }
    }
}

I am getting an error at

Drawable mDrawable = getResources().getDrawable(R.drawable.heart);
mDrawable.setColorFilter( Color.MAGENTA, Mode.MULTIPLY );
mInnerAuraImage.setImageDrawable(mDrawable);

Would somebody help me why this happen in 2.2? What would I do with this Drawable?

My Logcat output for error:

06-01 18:59:15.563: ERROR/AndroidRuntime(508): FATAL EXCEPTION: main
06-01 18:59:15.563: ERROR/AndroidRuntime(508): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kihealer.aura/com.kihealer.aura.Aura}: android.view.InflateException: Binary XML file line #50: Error inflating class <unknown>
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.os.Looper.loop(Looper.java:123)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.main(ActivityThread.java:3683)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invokeNative(Native Method)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at java.lang.reflect.Method.invoke(Method.java:507)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at dalvik.system.NativeStart.main(Native Method)
06-01 18:59:15.563: ERROR/AndroidRuntime(508): Caused by: android.view.InflateException: Binary XML file line #50: Error inflating class <unknown>
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at  android.view.LayoutInflater.inflate(LayoutInflater.java:276)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.Activity.setContentView(Activity.java:1657)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at com.kihealer.aura.Aura.onCreate(Aura.java:83)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     ... 11 more
06-01 18:59:15.563: ERROR/AndroidRuntime(508): Caused by: java.lang.reflect.InvocationTargetException
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at java.lang.reflect.Constructor.constructNative(Native Method)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     ... 23 more
06-01 18:59:15.563: ERROR/AndroidRuntime(508): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.Bitmap.nativeCreate(Native Method)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.Bitmap.createBitmap(Bitmap.java:444)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:498)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:473)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.content.res.Resources.loadDrawable(Resources.java:1709)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.widget.ImageView.<init>(ImageView.java:118)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     at android.widget.ImageView.<init>(ImageView.java:108)
06-01 18:59:15.563: ERROR/AndroidRuntime(508):     ... 26 more
06-01 18:59:15.655: WARN/ActivityManager(74):   Force finishing activity com.kihealer.aura/.Aura

Thanks.

  • 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-05-22T20:49:56+00:00Added an answer on May 22, 2026 at 8:49 pm

    It looks like one of the images in your layout is causing an OutOfMemory exception, possibly @drawable/outeraura.

    I would check the amount of RAM that you have assigned to the emulator, and also look at the size of your drawable images. If they are large then you will get speed and memory improvements by scaling them down to match the target screen density.

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

Sidebar

Related Questions

I have three tables being used for this problem: songs, blacklist, and whitelist. The
I have used copydir to copy a directory tree but it is deprecated. My
I have used the cURL solution to solve XSS but there is an issue
I am trying to do a layout similar to the one used in iphone
I have two questions. The first, when i load the activity first item of
I have an Android app that pulls in images from the Web. However when
In my page i have used div for store the images.In that div is
I have used getopt in Python and was hoping there would be something similar
I have used the String Tokenizer in Java. I wish to know if there
I want to create tree structure using web service. I have used bottom up

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.