1. Check out our app, Forums for Android! Download and leave feedback here!

Prevent app from being destroyed when android goes into sleep mode

Discussion in 'Application Development' started by id0001, Jun 10, 2010.

  1. id0001

    id0001 Well-Known Member
    Thread Starter
    38

    Apr 20, 2010
    142
    23
    38
    Student.. also software developer
    Netherlands
    I am developing some sort of web image viewer which gets a list of images from the web and shows it to the user.

    My problem is that when android goes into sleep mode by waiting for the screen to turn black or by pressing the powerbutton, my app gets destroyed and reloads when android awakens again. It is then reset and needs to reload all the images I downloaded earlier.

    When I download the images I put them in the cache and add a string id to a buffer class so the app can download images async in the background and the user can quickly navigate through images.

    Is there a way to prevent my app from being destroyed when android goes to sleep mode?

    Thanks in advance.
     

    Advertisement

  2. mikech

    mikech New Member
    5

    Jun 11, 2010
    1
    0
    5
    San Fran & Vegas
    Hi,
    I'm brand new to coding on Android and in general, but I've been reading the docs for the past several hours and I think this is the answer to your problem. I'm not sure if it works on sleep, but it sounds like it should:

    Application Fundamentals | Android Developers

     
  3. id0001

    id0001 Well-Known Member
    Thread Starter
    38

    Apr 20, 2010
    142
    23
    38
    Student.. also software developer
    Netherlands
    I've just tried it but it didn't work. It still destroys and reloads my activity.
     

Share This Page

Loading...