how to capture onscroll event of mapview in android?
<p>i wish to make an android applicaiton in which the data to be displayed on the map is dynamically loaded when the user scrolls on the map.
For this i need to capture the onscroll event of the mapview. There is no default onscrolllistener for mapview provided in the sdk.</p>

<p>i have found the following solutions:</p>

<ol>
<li><p>start a timer task every x seconds to check if the current center of the map is the same as its old center. if not load the new markers.</p></li>
<li><p>start a ontouchlistener for the map and capture the motion event. The code i am using for this is as following:</p>

<pre><code>    @Override
    public boolean onTouch(View arg0, MotionEvent arg1) {
        if (arg1.getAction() == MotionEvent.ACTION_MOVE) {
            Log.i("rohan", "onmovement captured");
            GeoPoint gp = ((MapView) arg0).getMapCenter();
            int lat = gp.getLatitudeE6();
            int lng = gp.getLongitudeE6();
            view1CustomAddress =(some url)
            new view1GetMapsInformationThread().execute(null);
        }
        return false;
    }
});
</code></pre></li>
</ol>

<p>but the above is not getting called when i scroll through the map.</p>

<p>3.The last and the most tedious of them all is i extend the mapview and then override the compute scroll method.</p>

<p>i do not wish to resort to sol 3. If anybody could tell me a simpler way to capture when the user has scrolled so that i can dynamically load the overlays(this i know how to do) i would be most obliged.</p>

<p>Also if someone could tell me why my sol 2 is not working, it would also be of help.</p>

<p>Thank you in advance.</p>
