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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:38:07+00:00 2026-06-01T21:38:07+00:00

What I want to do is adding GeoPoints on a google mapView. This is

  • 0

What I want to do is adding GeoPoints on a google mapView. This is what my code now looks like:

    public ArrayList getLocations() {
        ArrayList<OverlayItem> locations = new ArrayList<OverlayItem>();
        /* open SQLite database aanmaken als deze al dan niet bestaat */ 

    SQLiteDatabase myDB = openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); 
    SharedPreferences preferences = getSharedPreferences("data", 0);
    String route_id = String.valueOf( preferences.getInt("route_id", 0));

    String[] resultColumns = new String[] { "_id", "route_id","naam", "lng", "lat" };
    String whereClause = "route_id=?";
    String[] whereArgs = new String[] {route_id};

        Cursor cursor = myDB.query(DATABASE_TABLE_LOCATIES, resultColumns, whereClause,
                whereArgs, null, null, null, null);

        cursor.moveToFirst();
        do {
            String naam = cursor.getString(2);
            Double lat = cursor.getDouble(4);
            Double lon = cursor.getDouble(3);
            GeoPoint point = new GeoPoint((int) (lat * 1E6),(int) (lon * 1E6));
            locations.add(new OverlayItem(point, naam,naam));
        } while (cursor.moveToNext());



   return locations;
    }

public void onCreate(Bundle savedInstanceState) {
  InterestingLocations funPlaces = new InterestingLocations(marker);
  mapView.getOverlays().add(getLocations);
}

This code is putting all my pointers at once on the mapView. I would like a small delay when putting each pointer on the map.
How could I do this?

Thanks in advance

  • 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-01T21:38:08+00:00Added an answer on June 1, 2026 at 9:38 pm

    First define global variable,

    private Timer myTimer;
    

    add this inside onCreate() method:

    myTimer = new Timer();
        myTimer.schedule(new TimerTask() {
            @Override
            public void run() {
                TimerMethod();
            }
    
        }, 0, 1000);
    
    }
    

    and add this function in the class:

    private void TimerMethod()
    {
        this.runOnUiThread(Timer_Tick);
    }
    

    and define this as global variable:

    private Runnable Timer_Tick = new Runnable() {
    public void run() {
    
        //here is your job, instead of writing this [mapView.getOverlays().add(getLocations);]
    
        //you have to create a loop for the list returned by getLocations() to add them in the timer one by one
    }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am adding items to a ListBox like so: myListBox.Items.addRange(myObjectArray); and I also want
I want when adding a new item with jquery $(#dve option).dblclick(function() { $(this).clone().appendTo(#edno); });
I want update a column by adding days to current time. In pseudosyntax it
I want to update a column by adding a new value alongside the old
I want to overload the + operator for adding segments together to form a
When adding a float attribute to my opengl fragment (i want to find to
I want to create a JToolBar without adding it into any JFrame window. If
I want to remove a css class before adding a new class to an
I am adding the LinearLayout(child view) to another LinearLayout(parentview) programatically here I want to
Using NHibernate ICriteria and adding .AddOrder ... I want to sort by a property

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.