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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:28:25+00:00 2026-05-22T17:28:25+00:00

I have created a Live Wallpaper which takes a file chosen by the user

  • 0

I have created a Live Wallpaper which takes a file chosen by the user to be the background image.

The problem I’m having is that when I click ‘Set Wallpaper’ it begins my wallpaper service, then if I go back into my live wallpaper and click ‘Set Wallpaper’ again, it doesn’t seem to close the previous service, but just runs another as well. This means each time I click ‘Set Wallpaper’ an image from the users SD card is read into a Bitmap variable and increases the memory used each time, which eventually throws an OutOfMemoryError.

My onDestroy() method nullifies all Bitmap references and does System.gc(), however in this case, it seems the service isn’t being destroyed when setting the same wallpaper over it.

For example, if I had my wallpaper set, then chose to set the ‘Galaxy’ live wallpaper, this would destroy my wallpapers service, but when setting my wallpaper again, it does not destroy the original service.

Has anyone come across this before? Is there a different method I should be nullifying and garbage collecting in? Any help would be much appreciated.

  • 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-22T17:28:25+00:00Added an answer on May 22, 2026 at 5:28 pm

    I’m pretty sure I’ve figured it out for anyone else having this problem.

    It seems that when I already have my wallpaper running, then I click ‘Set wallpaper’ on its preview, the onDestroy() method isn’t called. However, nullifying Bitmaps and calling stopSelf() can be put in the onSurfaceDestroyed method, this seems to work for each instance of the WallpaperService Engine open. It might not be the correct way to do things but it seems to work ok at the moment.

    Thanks to GeekYouUp for help with stopSelf().

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

Sidebar

Related Questions

I have created a simple image slider 'Live Wallpaper' that will call in an
I have created an Activity (CodeActivity) that retrieves the temperature where I live. I
I have created simple .aspx page which queries a database for some live data
I have created Live Wallpaper app. When I start this via Wallpapers -> Live
I have created a PHP-script to update a web server that is live inside
I have created a simple app. Now I want to have a live wallpaper
I have created a php file that exports data to an excel file using
I have created a very simple ASP.NET application with a web.config file, which contains
I am developing a live update for my application. So far, I have created
I have created some JQuery that will expand a div 'popup' on hover 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.