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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:06:40+00:00 2026-05-27T19:06:40+00:00

I have created a map application to show near by places on the map.When

  • 0

I have created a map application to show near by places on the map.When the user clicks on the pin on the map a Alert dialog box pops up asking user to show the route.My problem is that when the pin is clicked many times at quick succession the message box is appearing more than once.I don’t want that message to appear more than once.Can anyone help me in this? My code is:

    protected boolean onTap(int pos) {

    final ProgressDialog myDialog = ProgressDialog.show(LocationBasedServicesV1.this, "", "Please Wait...");
         OverlayItem item = items.get(pos);
          Thread backgroundThread = new Thread(new Runnable(){
        @Override
        public void run() {
             runOnUiThread(new Runnable() {                    
             @Override
              public void run() {
                 AlertDialog.Builder dialog = new AlertDialog.Builder(  LocationBasedServicesV1.this);
                dialog.setTitle(listDetailsVO.getName());
                dialog.setMessage("Address: "+destination+"\nPhone: "+finalPhone+"\nEmail Id: "+finalEmail+"\nDistance: "+finalDistance+unit);
                dialog.setPositiveButton("Show Route", new DialogInterface.OnClickListener(){
                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    try {
                        Intent i = new Intent(LocationBasedServicesV1.this, ShowRouteActivity.class);
                        i.putExtra("destination", destination);
                        i.putExtra("source", currentAddress);
                        startActivity(i);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
            });
            dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener(){
            @Override
            public void onClick(DialogInterface dialog, int which) {
            }
           });
         dialog.show();
         }
        }); 
        myDialog.dismiss();
        }
        });
        backgroundThread.start();
    }
  • 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-27T19:06:40+00:00Added an answer on May 27, 2026 at 7:06 pm

    check the position for pin suppose you have 5 pin then user click on 3 position pin again user click on same pin then you got the same position into the onTap() method then just do nothing otherwise just dismiss the last open (if you required) and create new dialog/ use existing dialog and show on that position

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

Sidebar

Related Questions

I have created Map application for iPhone using xcode 3.2 and sdk 4.3.2. I
I have created a map application for android smart phones and I want it
I am new to iphone development.I have created a map application.I have created a
I am new to iphone development.I am creating a map application. I have created
I have created Map application and it is running on my mac machine with
I am new to iphone development.I have created map applications and displayed the cuurent
I have an ArcGIS map created with Flex. The labels created dynamically are the
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a JavaScript application that requires all images to be preloaded first.
I have created a window-based application and my problem is I am unable to

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.