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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:14:29+00:00 2026-06-06T14:14:29+00:00

everybody! I draw a plot based on some data in my app. The plot

  • 0

everybody!

I draw a plot based on some data in my app. The plot is with scrolling and zooming. I create 2 bitmaps for this purpose in MyMainFragment.onActivityCreated().

if (bitmaps[0] != null)
      {
         return;
      }    

final int deviceWidth = getResources().getDisplayMetrics().widthPixels;
          final int deviceHeight = getResources().getDisplayMetrics().heightPixels;
          final int deviceMaxDim = Math.max(deviceHeight, deviceWidth);

          bitmaps[0] = Bitmap.createBitmap(
             deviceMaxDim * 2,
             deviceMaxDim * 1,
             Bitmap.Config.ARGB_8888);

          bitmaps[1] = Bitmap.createBitmap(
           bitmaps[0].getWidth(),
           bitmaps[0].getHeight(),
           bitmaps[0].getConfig());

I need 2 bitmaps and not only 1 because of the drawing algorithm I use. Running the program on Asus Transformer, the bmp size in pixels is 1280 * 2 * 1280, thus the byte size being 1280 * 2 * 1280 * 4. When I run the program from Eclipse, everything’s fine. But when I launch it like an ordinary user from the tablet, it crashes every second time.

What’s happening behind the scene when I launch my app from Eclipse that allows it to run and can I follow the same steps programmatically so that it doesn’t crash when launched normally? Or should I use some other drawing algorithms (maybe something like OpenGL)?

Thanks a lot.

  • 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-06T14:14:31+00:00Added an answer on June 6, 2026 at 2:14 pm

    The solution was simple. I created a Canvas somewhere in my code, called Canvas#setBitmap(bitmaps[?]) on it, but didn’t realise, that I must call Canvas.setBitmap(null) to free the reference.

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

Sidebar

Related Questions

everybody! I'm trying to digitally sign some data in C#. Everything goes without error
Everybody.. I have create one universal application.. My app worked fine to only two
everybody! Could I ask you to help me to decode this JSON code: $json
Hi everybody I'm new and I'm having some trouble with a connection with netbeans
Hi everybody and thanks for your time, I read filenames in a QList. This
everybody, I have some problem related to the jenkins and git. I created a
everybody! I'm making a Android program and I need to list some texts on
Everybody knows the standard procedure to keep your app alive, after the user pressed
Hello everybody I have this string: [JOLLY BLU at STAY SHIP, Voy: 0275/11] How
I am using core-plot library to draw a bar-chart on my iPhone application and

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.