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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:31:28+00:00 2026-06-09T21:31:28+00:00

my app doesn’t currently crash BUT we are trying to make it very robust

  • 0

my app doesn’t currently crash BUT we are trying to make it very robust and one thing we are doing is keeping track of the time of “some event” until it is manually stopped by the user.

My Intended Implementation

This is how I was planning on implementing this. I was going to make it so when they submit the initial “event” it start timing and starts the initial time and the rest of the event in our SQLite database. Then a button appears on the same submit screen to STOP timing the event. We want to have accurate time tracking for the event. I would set a flag in preferences to say there is an event that is in progress and another preference with its unique id.

Concern

So my concern is this: if the app crashes or something bad happens, I want to give the person an option to change the end time for the event.
I was going to do this in one of two ways:
1. Do a check when the app starts up again (if there is a way to do this) that asks if the flag is set still, and if the app just started up. Then give them this option to edit.
2. If it exists, call an onTerminate method or something that android uses when it closes EVEN if it crashed. Again, I don’t know if this exists.

Any suggestions?

  • 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-09T21:31:30+00:00Added an answer on June 9, 2026 at 9:31 pm

    Issue a sendStickyBroadcast(Intent) with the state in the broadcast. At any later time register a null receiver for the sticky broadcast and you will have the last known broadcast state. Does not matter if it went down. So you might have one broadcast on startup etc.

    and off course when app starts up again is ON_BOOT_COMPLETED intent broadcast which you will want to listen for.

    Also DO NOT count on Android calling any particular methods on crash.

    The general principal is this: If there is something important to save (ncluding state), do it immediately like issuing stickyBroadcast or store as a SharedPreference. Don’t wait for any particular callbacks or crash event handling. There is nothing that cannot be handled by just saving state information immediately and handling ON_BOOT_COMPLETE or checking if first startup value in SharedPreferences. This is really no different than checksums. Starting your event is the beginning of a message. You should have an end of message too. Or end of event event. If you don’t see it you did not succeed. Just issue last state frequently, and recover accordingly.

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

Sidebar

Related Questions

Apache 2.2.17 PHP 5.3.3 Currently, my app doesn't use gzip, but I would like
I've got stuck with a serialization problem. My Silverlight app doesn't expect one of
I have setup airbrake in my app but it doesn't seem to log any
My problem is: my app doesn't install sd card. But I write this code
have been trying couple of hours now to make my iphone app universal. The
I am trying to cover my bases with reachability so that my app doesn't
I am trying to make a BBM Connected App, using the BBM 1.3 SDK.
My app doesn't run on the slower hardware, but I want to support iOS
We need to interface to 3rd party app, but company behind the app doesn't
FunctionalJava app throws StackOverflowError with Stream in stack trace, but the app doesn't (seemingly)

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.