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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:43:21+00:00 2026-05-27T14:43:21+00:00

I am using this alert dialog: public void displayAlert() { new AlertDialog.Builder(getActivity()).setMessage(R.string.invitenotice) .setTitle(Invite Notice)

  • 0

I am using this alert dialog:

public  void displayAlert() 
        { 
         new AlertDialog.Builder(getActivity()).setMessage(R.string.invitenotice)   
               .setTitle("Invite Notice")   
               .setCancelable(true)   
               .setNeutralButton(android.R.string.ok,   
                  new DialogInterface.OnClickListener() {   
                  public void onClick(DialogInterface dialog, int whichButton){ 
                     finish();
                  }   
                  })   
               .show();  
        } 

my problem is when I click ok I don’t want to use finish(); I just want to dismiss the dialog. Any help is appreciated. Or maybe a more simple way of creating a simple dialog box when I press a button ? Thanks everyone. Also, a problem is I get 4-6 instances of the dialog box. So i need to press ok 4-6 times until it dissapears. Where I put the listener to my button is here :

   findViewById(R.id.mainHelp).setOnTouchListener(new OnTouchListener() { 
            @Override 
            public boolean onTouch(View v, MotionEvent event) { 
                               displayAlert(); 
                   return false; 
}}); 

in the onCreate() method

  • 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-27T14:43:22+00:00Added an answer on May 27, 2026 at 2:43 pm

    remove finish() default action is dismiss. so don’t put anything in on click().

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

Sidebar

Related Questions

AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(Title); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,
Here's my code: private void makeDialog2() { AlertDialog.Builder about = new AlertDialog.Builder(getContext()); about.setTitle(You Won!);
i am using this code to show alert dialog...when i click on the ok
Im using this code: $(this).css('backgroundcolor', localStorage.getItem('bgColorr') + !important;); When i write: alert( localStorage.getItem('bgColorr') +
$.each(3,function(i){ alert(i) }) alert 0,1,2 how to do this using jquery? thanks
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
UPDATED: Hi i'm using spinner within AlertDialog.Builder to show the list of options to
I'm opening an Activity using this: startActivity(new Intent(Parent.this, Child.class)); And on the child, I
I am using a custom Alert dialog. If user go with negative button of
I've got this dialog (I'm simplifying my use case): class EditShoppingListDialog extends AlertDialog {

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.