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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:15:57+00:00 2026-06-13T15:15:57+00:00

What I want to do: When the application starts it reads an email address

  • 0

What I want to do: When the application starts it reads an email address from a database. If the email address is NOT set, it starts another dialog activity for adding the email address.

If the user doesn’t add the email, he cannot close that dialog activity, so clicking on close button doesn’t close the dialog activity.

The problem that I have is that if the user clicks the back button, the dialog activity closes and the main activity starts without email address set. What I want to do is if the user clicks the back button in this case, to close the application.

I have to mention that I’m using the same dialog activity when I want to edit the email address.

  • 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-13T15:15:58+00:00Added an answer on June 13, 2026 at 3:15 pm

    Override onBackPressed, there check whether user has inserted any email address. If not just return without calling super.onBackPressed().

    @Override
    public void onBackPressed() {
        if(yourEmailEditText.getText() == null 
           || yourEmailEditText.getText().toString().trim().length() == 0){
              return
        }
        super.onBackPressed();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing iPhone application which starts from a UIViewController. What I want
I mean when the user starts my application(exe). I want it to start directly
I have an application written in Python 2.7 that reads user's file from the
i want to start an application on receiving sms from a particular number. i
my application reads from a char device, which is filled from kernel space. Currently
After an HTTP POST (generated by an application, not by users) I want to
I want to store the setting of my j2me application. When application starts, the
I have an unfinished application, but I want to address now the future update
When my application starts I need to load about 500 objects from an xml
I am wrting a small csharp console application which reads text from console, do

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.