Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer never fires under certain circumstances #5

Open
joneswah opened this issue Sep 20, 2012 · 4 comments
Open

Timer never fires under certain circumstances #5

joneswah opened this issue Sep 20, 2012 · 4 comments

Comments

@joneswah
Copy link

I found that computeScroll is indefinitely called under certain circumstances particularly when zoomed out, which means that the timer always is reset and never fires. So I needed to modify your computeScroll() method to check how many times it had been called and only reset it if it is under a specific limit.

private int computeScrollCount = 0;
private final static int MAX_SCROLL_COUNT = 25;

@Override
public void computeScroll()
{
    super.computeScroll();

    // Check for change
    if (isSpanChange() || isZoomChange())
    {
        if (computeScrollCount < MAX_SCROLL_COUNT) {
            // If computeScroll called before timer counts down we should drop it and 
            // start counter over again but dont let this occur indefinitely
            resetMapChangeTimer();
        }
        computeScrollCount++;
    }
}

then you need to reset the computeScrollCount=0 when the Timer fires.

@bricolsoftconsulting
Copy link
Owner

Dan, thanks for the report and suggested changes. Can you tell me more about the Android version(s) and device model(s) which display this behavior?

@joneswah
Copy link
Author

Nexus7 Tablet 4.1.1
I found that the timer wasn't always firing when panning/zooming when zoom level < 9. you had to wait until the screen went to sleep until it finally fired.

I am not sure if it is specific to the particular overlays that I am using?

Actually I have the MyCurrentLocation to display the current users location so maybe that is the cause!

@filipebatista
Copy link

I have the MyLocationOverlay to display the current users location and when it is visible on the map the timer isn't always firing when panning/zooming ,
I have tested in a Samsung Galaxy S3

@theojalba
Copy link

@filipebatista Did you use the provided APK from the release folder to test on the Galaxy S3? Usually that is the best way to determine if the original code does not work, or if something in your program may be interfering with the original the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants