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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:15:31+00:00 2026-06-01T07:15:31+00:00

I have a for loop, inside which I’m calling a method to show the

  • 0

I have a for loop, inside which I’m calling a method to show the poi’s in map. Now what I am trying to do is to show each poi in a sequence. I mean now the for loop completes at a stretch and at last is presented with the final output.

But I want it to be in order, that mean each time for loop iterates I should be able to see the animation where these geopoints are moving from place to place.

Here is my code,

 for (i=currentPOIindex;i<arraypoi.size();i++) {
            poi = arraypoi.get(i);
            latitude = poi.getLatitude().toString();
            longitude = poi.getLongitude().toString();
            placename = poi.getPlaceName().toString();
            mapdescription = poi.getPoiDecsription().toString();
            lat = Double.parseDouble(latitude);
            lng = Double.parseDouble(longitude);
            //use the poiIndex to identify which poi is highlighted
            itemizedOverlay.poiIndex = i;
            geopoint = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
            OverlayItem overlayitem = new OverlayItem(geopoint,fitTextToMapCallout(placename), fitTextToMapCalloutDescription("hello"));
            itemizedOverlay.addOverlay(overlayitem);
            mapOverlays.add(itemizedOverlay);
           //this method is meant to move to each geopint one by one. 
           //And I am trying to give a delay before this method is called
            moveToPOI(i);
        }


  public void moveToPOI(int currentPOI) {
    try {
        AudioMapOverLay overlay = (AudioMapOverLay) mapOverlays.get(currentPOI);
        poi = arraypoi.get(currentPOI);
        latitude = poi.getLatitude().toString();
        longitude = poi.getLongitude().toString();
        placename = poi.getPlaceName().toString();
        lat = Double.parseDouble(latitude);
        lng = Double.parseDouble(longitude);
        geopoint = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
        overlay.onForwardOrRewind(currentPOI, overlay);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

I tried using Thread.sleep(long ms); But it is not the solution, can any one tell me what to do?

  • 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-01T07:15:33+00:00Added an answer on June 1, 2026 at 7:15 am

    Finally I have come up with the answer. @Niko and @Herry, I don’t know if this is similar to your code.

    here is my change,

         notification = new Runnable() {
                public void run() {
                    testgeo();
                }
            };
            handler.postDelayed(notification, 1500);
    

    where testge0() is,

     private void testgeo() {
        poi = arraypoi.get(index);
        latitude = poi.getLatitude().toString();
        longitude = poi.getLongitude().toString();
        placename = poi.getPlaceName().toString();
        // mapdescription = poi.getPoiDecsription().toString();
        lat = Double.parseDouble(latitude);
        lng = Double.parseDouble(longitude);
        if (index == currentPOIindex) {
            drawable = this.getResources().getDrawable(R.drawable.poiiconactive);
            itemizedOverlay = new AudioMapOverLay(drawable, objMapView,this);
        } else {
            drawable = this.getResources().getDrawable(R.drawable.mapicon);
            itemizedOverlay = new AudioMapOverLay(drawable, objMapView,this);
        }
        itemizedOverlay.poiIndex = index;
        geopoint = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
        OverlayItem overlayitem = new OverlayItem(geopoint,fitTextToMapCallout(placename),
                fitTextToMapCalloutDescription("hello"));
        itemizedOverlay.addOverlay(overlayitem);
        mapOverlays.add(itemizedOverlay);
        moveToPOI(index);
    }
    

    But thank you for your help. This is working for me

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

Sidebar

Related Questions

I have the following loop inside an function init(); which is executed onload, I
Hi I have a quick question, which is the easiest way to loop inside
I have a for loop in Matlab; inside it I am calling a function
I have the following query which is inside a loop and is breaking SELECT
I have a for loop inside which I am making a Ajax call which
I have php code which executes a loop, inside which it generates the following:
I have a loop written in C++ which is executed for each element of
I have some problems with controlling a while loop inside an event structure. Say
I have a for loop. Inside that loop I want to fill up an
I have created a loop, inside there is an if statment but it doesnt

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.