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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:12:02+00:00 2026-06-05T15:12:02+00:00

I’m building a live wallpaper, it has a bitmap with fullHD resolution which is

  • 0

I’m building a live wallpaper, it has a bitmap with fullHD resolution which is scaled down to the size of the users phone screen. It works perfectly on Android 2.2 and 2.3 but crashes on 4.0.

EDIT :

I narrowed the problem down a little bit using try/catch and found out it starts from my run() method. With that MacGyver fix it runs about 20 seconds flooding the following error message and then crashes:

05-31 20:01:22.590: E/SurfaceTextureClient(1475): dequeueBuffer failed (No such device)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475): Exception locking surface
05-31 20:01:22.590: E/BaseSurfaceHolder(1475): java.lang.IllegalArgumentException
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at android.view.Surface.lockCanvasNative(Native Method)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at android.view.Surface.lockCanvas(Surface.java:76)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at com.android.internal.view.BaseSurfaceHolder.internalLockCanvas(BaseSurfaceHolder.java:184)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at com.android.internal.view.BaseSurfaceHolder.lockCanvas(BaseSurfaceHolder.java:157)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at com.pelkkala.test.TestWall$TestMachine.run(TestWall.java:255)
05-31 20:01:22.590: E/BaseSurfaceHolder(1475):  at java.lang.Thread.run(Thread.java:856)
05-31 20:01:22.601: E/ERROR(1475): ERROR IN CODE: java.lang.NullPointerException
05-31 20:01:22.621: W/System.err(1475): java.lang.NullPointerException
05-31 20:01:22.621: W/System.err(1475):     at com.pelkkala.test.TestWall$TestMachine.draw(TestWall.java:233)
05-31 20:01:22.636: W/System.err(1475):     at com.pelkkala.test.TestWall$TestMachine.run(TestWall.java:264)
05-31 20:01:22.636: W/System.err(1475):     at java.lang.Thread.run(Thread.java:856)

Here is my run() method:

        public void run() {

        while (running) {
            //perform canvas drawing
            if (!holder.getSurface().isValid()) {
                continue;
            }

            mTimer = System.currentTimeMillis();

            if (mTimer - oldTime > 50) {
                oldTime = mTimer;
                try {
                    Canvas c = holder.lockCanvas();

                    if (!touching) {
                        oscillate(xOrig, yOrig);
                    }
                    if (!touching2) {
                        oscillate2(xOrig2, yOrig2);
                    }

                    draw(c);        
                    holder.unlockCanvasAndPost(c);
                }
                catch (Exception e) {
                    Log.e("ERROR", "ERROR IN CODE: " + e.toString());
                    e.printStackTrace();
                }
            }
        }   
    }

EDIT 2 :

Could it have something to do with the emulator? I’m not able to access Android 4 device right now so that’s what I have.

  • 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-05T15:12:04+00:00Added an answer on June 5, 2026 at 3:12 pm

    I’m still not sure why this happens with Android 4 but this is how I solved it.

    This was causing me trouble:

    class TestEngine extends Engine implements Runnable {}
    

    So I changed it to something like this:

    class TestEngine extend Engine {
    
        private final Runnable testRunnable = new Runnable() {
            public void run() {
                drawFrame();
            }
        };
    
        public void drawFrame() {
    
            //Draw on canvas and unlock
            ...
            mHandler.postDelayed(testRunnable, 1000 / 50);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters

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.