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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:01:10+00:00 2026-05-20T22:01:10+00:00

When the users presses the back button in my application. Here is the scenario:

  • 0

When the users presses the back button in my application. Here is the scenario:

  1. User starts the application – Activity
    shows up
  2. User presses back button
  3. User re-starts the application. At this point application just shows a blank screen, none of the buttons(home/back) respond, after
    some time Force-close dialog comes up.

    NOTE: If the user presses “Home” and then relaunches the app, this doesn’t happen, only if the user presses “Back” and then relaunches it.

In my onCreate() I have some network setup code. However, onDestroy() has the corresponding cleanup code, so I don’t understand why this is happening.

@Override
public void onCreate(Bundle savedInstanceState) {
    Log.d(DEBUG_TAG, "onCreate()");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

     // Aquire the multicast lock
     // Create an instance of JmDNS
     // Add a listener for Bonjour services of a given type 
}

@Override
protected void onDestroy() {
    Log.d(DEBUG_TAG, "onDestroy()");
     // Remove the services listener 
     // Set the reference to JmDNS instance null
     // Release the multicast lock
    super.onDestroy();
}

Not sure what is going on, and don’t know how to debug this.

Interestingly – “Zeroconf Browser” a popular app that I downloaded from Android Market to use to debug mine – seems to have the same issue.

EDIT: Changed the code from onStart()/onStop() to onCreate()/onDestroy(). Same problem as before.

EDIT: For anyone who runs in a similar problem, this is what was causing my misery. Android code wasn’t the culprit:
http://sourceforge.net/tracker/index.php?func=detail&aid=2933183&group_id=93852&atid=605791

  • 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-20T22:01:10+00:00Added an answer on May 20, 2026 at 10:01 pm

    You may be making network requests on the UI thread. You might checkout Painless Threading and AsyncTask for handling that.

    Note that it might be a good idea to do your setup and tear-down in onCreate and onDestroy. onStart can be called multiple times during the activity’s life cycle; is your code guarding against this case?

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

Sidebar

Related Questions

In my application, after the user presses the appropriate button, an activity starts that
How can I dismiss dialog in Cocoa application when user presses Esc or Enter
I'm writing an application which will have two Activities, when the user presses the
Can SWFAddress sense when a user has pressed the browser back button? I know
So I want to trigger an event (pausing/unpausing some media) whenever the user presses
Does anyone know why the KeyPress Event doesn't get fired when the user presses
I have a Page with a UserControl on it. If the user presses Esc
My users are having an intermittent error when using a Windows Forms application built
So within my application is a form for creating a new user, with relevant
Here's the situation: I have a web application which response to a request for

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.