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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:01:53+00:00 2026-06-08T22:01:53+00:00

I am playing an animation by using runnable thread inside a surface view. When

  • 0

I am playing an animation by using runnable thread inside a surface view. When I run the application for the first time, everything works fine and animation plays properly. When I press back/home button and reopens the application, I am getting a Black Screen with no animations but the runnable thread works on the background which I confirmed using Log cat entry.

Also, I am overriding the back button press event and finish() is called inside the back button press event.

Can any one please help me out why surfacecreated method is not being called when I resume the application?

Note : When I use

android.os.Process.killProcess(android.os.Process.myPid());

Inside the back button event instead of finish() method, the application works properly in onresume event.

Thanks in Advance, Tim

  • 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-08T22:01:56+00:00Added an answer on June 8, 2026 at 10:01 pm

    I think,you must extend SurfaceView class and listen on surfaceChanged method。And in the method to draw again.
    code:

    class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback{  
            SurfaceHolder holder;
            public MySurfaceView(Context context) {  
                super(context); 
                holder = this.getHolder();
                holder.addCallback(this); 
            }  
            public void surfaceChanged(SurfaceHolder holder, int format, int width,  
                    int height) {  
                //when surfaceChanged,i think you must make your view draw one time.
    
            }   
            public void surfaceCreated(SurfaceHolder holder) {  
                //surfaceCreated
            }    
            public void surfaceDestroyed(SurfaceHolder holder) {  
                //surfaceDestroyed
            }  
    
        } 
    

    Hope this can help you.

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

Sidebar

Related Questions

Playing with jquery for the first time, and I'm trying to get a simple
I'm working with some Core Animation for the first time and in the process
Playing with the ssh and public_key application in Erlang, I've discovered a nice feature
I'm playing around with a little jquery animation and trying to achieve a very
EDIT - After playing around with a bunch of potential solutions (using backgroundworker and
I'm playing around with GLX and xlib and I'm curious about rendering using straight
I've been playing with Corona for a couple of days and everything was going
I'm playing with Core Animation and I'm struggling with my last pet use case:
I'm using a VideoView in my Android app to display the intro animation. If
I am using Sparrow framework. I have been playing with moving sprites around using

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.