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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:38:54+00:00 2026-06-15T14:38:54+00:00

I have an app which starts from a splash screen and then navigates to

  • 0

I have an app which starts from a splash screen and then navigates to other activities. If i press the home button in a particular activity ,the app gets minimized. Again if i click on the app icon, the app starts from the splash screen. I want to resume my app from the activity in which the home button was pressed. How to achieve this?

   package com.xyz.user.login;

  import android.app.Activity;
  import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.ImageButton;

  public class ResetPasswordActivity extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.layout.menu, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.logout:
        // Single menu item is selected do something
        // Ex: launching new activity/screen or show alert message
        PopIt("Are you sure you want to exit?");
        return true;

    default:
        return super.onOptionsItemSelected(item);
    }
}

private void PopIt(String string) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage(string)
            .setCancelable(false)
            .setPositiveButton("Yes",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            Intent intent = new Intent(
                                    getApplicationContext(),
                                    SignInActivity.class);
                            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                            intent.putExtra("EXIT", true);
                            startActivity(intent);
                        }
                    })
            .setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            });
    AlertDialog alert = builder.create();
    alert.show();

}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.reset_password);
     ImageButton imgRPass=(ImageButton)findViewById(R.id.imgChangePass);
     imgRPass.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
        Intent intent=new Intent(ResetPasswordActivity.this,ResetPasswordMessageActivity.class);
        startActivity(intent);
        }
    });
     ImageButton imgBack=(ImageButton)findViewById(R.id.imgbtnBackFromResetPass);
     imgBack.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
            finish();
            }
        });
}

}

  • 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-15T14:38:56+00:00Added an answer on June 15, 2026 at 2:38 pm

    Maybe the code in your Activities has a call to finish() in onStop() or onPause(). That destroys the Activity when it’s minimised and causes the app to start again. There are other steps to take to be sure of restoring the state, but that is a good place to start looking.

    You could try putting this code in there to track what is going on.

    private static final String TAG = "ResetPasswordActivity";
    @Override public void onStart() {
        Log.d(TAG, "onStart:");
        super.onStart();
    }  
    @Override public void onResume() {
        Log.d(TAG, "onResume:");
        super.onResume();
    }
    @Override public void onPause() {
        Log.d(TAG, "onPause:");
        super.onPause();
    }
    @Override public void onStop() {
        Log.d(TAG, "onStop:");
        super.onStop();
    }
    @Override public void onDestroy() {
        Log.d(TAG, "onDestroy:");
        super.onDestroy();
    }
    

    There are calls to finish and startActivity in there, although I cannot see why they should be executed. I’d put a Log statement by each. Then try it again and see what the Logcat output says when you minimise and relaunch the app.

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

Sidebar

Related Questions

I have an app start by Splash activity screen for 5 seconds Then open
I have an Android app with 2 primary activities. When the app starts from
I have a Notification which starts an Activity. After a long press on home
I have got Sinatra/Rails app and an action which starts some long process. Ordinary
I have a small data collection app which has a single button to start
I have a app which will download a file from web. The download action
I have created an app which starts with a login page, after entering some
I have an c# app which creates and starts a directshow graph on the
I have two activities, Activity1 and Activity2 . Activity1 is launcher activity which starts
I have a layout where a splash screen asks for input from a user,

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.