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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:47:54+00:00 2026-06-13T17:47:54+00:00

I made this app that works fine, but when i leave the app and

  • 0

I made this app that works fine, but when i leave the app and open it again it always force closes. how can i make it so when the user presses the home and or back key it will kill the app process?

Making it so when the app is opened again it has a fresh start.

  • 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-13T17:47:55+00:00Added an answer on June 13, 2026 at 5:47 pm

    You are not supposed to “kill the process”. You should handle home button presses and other such interactions that navigate away from your app via the onPause() and onResume() methods.

    In your onPause() method, you should save the state of your app. This can range from saved it in Bundles, SharedPreferences, sqlite or whatever form of persistence is appropriate for your app.

    In your onResume() method, you should restore the state of your app so that the user is given an illusion that nothing has changed at all.

    This is how android handles multitasking and this is how you must accommodate it within your app as well to efficiently and reliable suit your app to the android framework.

    I suggest you go through the activity life cycles guide here first:

    http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

    More on pausing and resuming an activity specifically here:

    http://developer.android.com/training/basics/activity-lifecycle/pausing.html

    Also, you might want to read up on data storage options here:

    http://developer.android.com/guide/topics/data/data-storage.html

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

Sidebar

Related Questions

i made an iPhone app that uses camera. It works fine in iPhone, no
I have a Rails 3rc app on Ruby 1.9.2 that works fine, but Bundler
Hello community, I'm trying to debug that I didn't made. This app works online
I've made an android app that works fine in the emulator and when debugging
This is the case: I made an app using the Audio Streamer library that
I built this program that works with files. Since I made it for a
This is a bit complicated but here goes. I have a Rails app that
I have a slightly complicated setup that, of course, works fine in XP, but
When this callback is made in my app, I have quite a bit work
i made an app in architect. My store is this Ext.define('MyApp.store.storeMain', { extend: 'Ext.data.Store',

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.