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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:23:34+00:00 2026-05-25T06:23:34+00:00

I am working on a login screen for my application. If I open the

  • 0

I am working on a login screen for my application. If I open the application, by either running from eclipse or by selecting the application icon installed on the emulator, it will run an AuthUser.class which checks for a valid token on a remote server. If the user is not logged in then the AuthUser.class forwards to Login.class via…

if (authtoken.length() == 0 || authtoken.length() > 0
            && checkAuthToken(authtoken) == false) {
        Intent intent = new Intent();
        intent.setClass(AuthUser.this, Login.class);
        startActivity(intent);
        finish();
    }

This works great, as when I use the back button on the emulator it will close the app rather than go back to the login screen. Perfect.

Now when I am coming from a share menu, like when I select share icon on an image within the gallery, and then select my application from the popup menu I also forward to the Login.class via…

Intent intent1 = new Intent();
                intent1.setClass(SharePictureMenu.this, AuthUser.class);
                startActivity(intent1);
                finish();

Now when I login from here and it forwards to AuthUser.class as per usual, however, the back button press now takes me back to the login screen, even though I am forwarding and finishing exactly the same in both cases. Obviously I don’t want that behavior as I want it to close the app and return to the gallery after login so the user can continue to share images immediately without having to go back through the login screen.

Any suggestions, hacks or otherwise on fixing this would be greatly appreciated.

  • 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-25T06:23:35+00:00Added an answer on May 25, 2026 at 6:23 am

    If you are calling finish() on that activity, before that functions return it will be marked as finished by the activity manager and the user can not return to it. I don’t know of a way this could not happen. Make sure you are actually finishing that activity, and that you are not doing something like starting it twice.

    Some useful tools for debugging:

    • The output of “adb logcat” will contain a log for every activity that is started.
    • The output of “adb logcat -b events” will contain a log for every activity that is finished, with the reason why it was finished (and various other activity operations). You can combine this with the other with “adb logcat -b events -b system”.
    • “adb shell dumpsys activity” will give you the current activity stacks, so you can see the current activities being managed for your app and how they are related to others.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am working on an application.The first screen having login.After launching the application in
I am working on a single sign-on login page using Shibboleth that will be
I am working with AlertDialog for user login to an application.I have displayed two
I'm working on a C# application that needs to scrape some data from a
I'm currently working on a login screen where I am using jQuery and jQuery
I am working on an iPad application and need some help from you guys.
I am Working on simple login application in which user is first shown login
I am working on an Android application that requires a user to login before
Today, I installed GWT and Google App Engine plugins for eclipse. Everything was working
I tested my application on the emulator and it was working fine. The flow

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.