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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:42:55+00:00 2026-06-16T13:42:55+00:00

I figured out that executing phone lock on app startup gets my initial AsyncTask

  • 0

I figured out that executing phone lock on app startup gets my initial AsyncTask out of step because it doesn’t call onStart (where I attach and detach the Activity to the task) after unlock. Obviously phone lock mode means something different to any app than using Home or Back button, because in the latter ones, my app can deal with them. It seems that the locking/unlocking mode doesn’t close the app, but it doesn’t keep it running too, so in my opinion this is some kind of unexpected behavior which is very stupid because I “lose” my AsyncTask and my app is not getting initialized properly.

How can I execute some logic on phone unlocking, because the unlock/lock doesn’t seem to call any lifecycle methods? And do I have to distinguish between lock on/off and screen on/off?

  • 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-16T13:42:56+00:00Added an answer on June 16, 2026 at 1:42 pm

    I found a solution which works for me. Due to Squonks comment I saw that onResume will be executed. I was able to adapt the logic of my app so my app can handle the AsyncTask (attaching/detaching + showing progress dialog + initialization) in onResume now.

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

Sidebar

Related Questions

I've figured out that default ReceiveBufferSize (8192) doesn't work for me - I lose
I figured out that a constant literal get's placed in the data segment of
I figured out that CUDA does not work in 64bit mode on my mac
I figured out that of course . and SPACE aren't allowed. Are there other
I've figured out that the problem is only with the Build Settings tab. So
I created an UIViewController subclass, and figured out that the default implementation of -loadView
After some trial and error (ok, just error) I figured out that c089b69c3d contained
I'm writing HFT trading software. I'm trying to optimize it. I figured out that
I've figured out, that it's quite easy to purge a ressource out of Varnish
I've figured out a way to cache data (so that I won't have to

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.