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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:44:15+00:00 2026-05-21T08:44:15+00:00

That might be broad question but I will try to explain best. I will

  • 0

That might be broad question but I will try to explain best. I will also give code snippets if anything jumps out – please let me know.

I can’t repro this issue but it surface itself like so:

a. Sometime I would be logged in – I hit log out and will see my Activity refreshed. And that can happen many times. What I expect is Activity to close when I hit logout.

b. Sometime I’m on my Activity (already logged in) and started from icon. And I click back and it wouldn’t go to “desktop” and goes to activity again. And this can happen 1-3 times. I expect since this is main activity to go back to desktop when hit back.

c. I noticed similar kind of issue on Yahoo mail app so I’m not sure if that is bug or 2.3.1 issue on my Nexus S?

I have:
1. Main activity
2. Login dialog that is custom dialog.

This is code from my activity:

public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        //If not authorized yet then show sign in dialog
        if (!PreferencesManager.getIsUserAuthenticated(getApplicationContext()))
        {
            showDialog(1);
        }

        Button signOutButton = (Button) findViewById(R.id.SignOutButton);
        signOutButton.setOnClickListener(new View.OnClickListener()
        {
            public void onClick(View view)
            {
                PreferencesManager.setIsUserAuthenticated(false, getApplicationContext());
                **MainActivity.this.finish();**
            }
        });


    }

    @Override
    protected void onDestroy()
    {
        super.onDestroy();

    }

    @Override
    protected void onPause()
    {
        super.onPause();
    }

    protected Dialog onCreateDialog(int id)
    {
        LoginDialog dialog = new LoginDialog(this);

        dialog.setOnDismissListener(new DialogInterface.OnDismissListener()
        {
            public void onDismiss(DialogInterface dialog)
            {
                if (!PreferencesManager.getIsUserAuthenticated(getApplicationContext()))
                {
                    **MainActivity.this.finish();**
                }
            }
        });

        return dialog;
    }

In dialog class – I have regular stuff and “this.dismiss” if Login was successfull.

  • 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-21T08:44:16+00:00Added an answer on May 21, 2026 at 8:44 am

    Your activity is somehow getting created multiple times. This can be do to how it’s being run, if it’s a shortcut from your desktop or the app drawer, or holding home, or some other shortcut.

    You might want to look into launchMode at http://developer.android.com/guide/topics/manifest/activity-element.html

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

Sidebar

Related Questions

Typically I use E_ALL to see anything that PHP might say about my code
I've got a question concerning fields in databases which are measures that might be
Before I start with the real question, let me just say that I might
I have double (or float) variables that might be empty, as in holding no
I want to use Oracle exception to handle errors that might happen in the
I'm using the MessageBox class to show errors to users, and while that might
I'm using linq to pull back an object (i.e. customer) that might have a
I'm concerned that this might be working on an NP-Complete problem. I'm hoping someone
I wanted to set some handler for all the unexpected exceptions that I might
There might be applications that are not suited for Core Data - image manipulation

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.