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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:49:08+00:00 2026-05-23T14:49:08+00:00

I am trying to extend a scalable image viewer in Android to use two

  • 0

I am trying to extend a scalable image viewer in Android to use two images side-by side. To do this I am using Bitmap.createBitmap(int, int, Bitmap.Config). Unfortunately this seems to be crashing the VM.

The code is

    protected void combineBitmaps() {
        image0Width = bitmap0.getWidth();
        image0Height = bitmap0.getHeight();
        image1Width = bitmap1.getWidth();
        image1Height = bitmap1.getHeight();

//These methods just get correct values for image[0|1][Width|Height].
        int width = getCanvasWidth();
        int height = getCanvasHeight();

//THIS LINE CRASHES
        Bitmap bitmap_tmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

        bitmap = bitmap_tmp;

        Canvas combination = new Canvas(bitmap);

        combination.drawBitmap(bitmap0, 0f, getImage0VertOffset(), null);
        combination.drawBitmap(bitmap1, image0Width, getImage1VertOffset(), null);
    }

The value I am getting from getCanvasWidth() is 2464 and from getCanvasHeight() is 2048. The exception I am getting is

Unable to start activity ComponentInfo{com.tse.scview/com.tse.scview.ScalableViewWrapper}: android.view.InflateException: Binary XML file line #8: Error inflating class com.tse.scview.ScalableFacingPageView

where com.tse.scview.ScalableFacingPageView is the class we’re constructing (the constructor calls this function).

I’ve isolated everything from this line—the assignment of the bitmap to a class bitmap, the get width and height functions etc.—to determine that it IS in fact Bitmap.createBitmap that is causing the problem. Unfortunately I can’t work out what the problem is.

Update: as a sanity check I put in small values for the width and height (12 and 13 … well why not). It now works. So it’s a RAM problem, which is a pain for us, but effectively answers the question.

  • 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-23T14:49:09+00:00Added an answer on May 23, 2026 at 2:49 pm

    If I am reading your code and question correctly, the bitmap is 2464 x 2048 x 4 bytes. That’s 16 megabytes. And you are creating two of them. That’s 32 megabytes.

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

Sidebar

Related Questions

I'm trying to extend the SPL ArrayObject but I've hit a little snag. Using
I am trying to extend Visual Studio 2010 RC to be able to use
I'm trying to extend Object functionality this way: Object.prototype.get_type = function() { if(this.constructor) {
I trying to extend ConuntDownTimer to add the methods pause and resume in this
I'm trying to extend (not sure what is the correct term for this kind
I am trying to extend tree component in Vaadin. So I created client side
I'm trying to extend Python 3 using instructions given here and I'm fairly confident
I'm trying to extend one of my WebApps using IronPython, unfortunately the code below
I'm trying to extend the TextBox , ComboBox and Panel controls using IExtenderProvider but
I'm trying to extend the Array.push method so that using push will trigger a

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.