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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:33:02+00:00 2026-05-24T10:33:02+00:00

I just noticed some weird behaviour with my Android 2.3.3 application. I can write

  • 0

I just noticed some weird behaviour with my Android 2.3.3 application. I can write some extra code to deal with it, but I’d like to understand why it’s happening in the first place!

When I install via Xcode (just by hitting F11 and debugging as normal) the lifecycle for one of my activities is as follows when I simply start the app, let the activity appear, press the home button on my device to close it (minimize it), then open it up again.

onCreate
onStart
onResume
onPause
onStop
onRestart
onStart
onResume

However, if I export the application to an APK and install it by email, I get this behaviour:

onCreate
onStart
onResume
onPause
onStop
onCreate ******
onStart
onResume

… which is exactly the same, except that onCreate is called this time when I re-open the app.

I’ve looked at the lifecycle documentation and I thought that onDestroy had to be called before onCreate could be called when resuming? Is that a wrong assumption?

Thanks,

Steven

  • 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-24T10:33:06+00:00Added an answer on May 24, 2026 at 10:33 am

    To answer this I am going to have to assert several assumptions.
    1) You are tracking the life cycles by Log placed in the events for your activity
    2) Nothing else was changed about the system
    3) They debugger assists in keeping the activity alive when stopped

    You may not have an indicator for whether onDestroy() is called. onCreate() is only called when the activity is created (as against to resumed from a stopped state).

    As stated in the assumptions, the Debugger used is probably forcing the system to keep the app alive while in a stopped state. When you load it from the APK it is not in debug and so nothing is forcing it to stay alive. Once the onStop() is called, the system can kill the app to free up memory very quickly, calling onDestroy(). After this happens, onCreate() would have to be called again (because its was destroyed).

    You probably already read this but here you go:
    http://developer.android.com/reference/android/app/Activity.html

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

Sidebar

Related Questions

Just noticed the __block keyword in some Objective-c code like the following: // myString
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if
I was just writing some quick code and noticed this complier error Using the
OK, I realize that question might seem weird, but I just noticed something that
I've just noticed a very odd behaviour with VS2010. At some point since install,
I just noticed that by instance famous application like chrome didn't have any 64
I just noticed that you can do this in C#: Unit myUnit = 5;
I just noticed that you can not use standard math operators on an enum
I’m having some difficulties while trying to consume an unmanaged-code dll from my application
I've just downloaded AFNetworking to try and mess with it, but i'm having weird

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.