Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

getSelectedView returns null instead of the correct view #10

Closed
jspeth opened this issue Jun 24, 2011 · 0 comments
Closed

getSelectedView returns null instead of the correct view #10

jspeth opened this issue Jun 24, 2011 · 0 comments

Comments

@jspeth
Copy link

jspeth commented Jun 24, 2011

getSelectedView checks the mCurrentAdapterIndex against the length of mLoadedViews. This will be false for positions greater than the loaded views, so it will return null.

I'm pretty sure that it should be checking mCurrentBufferIndex instead, so getSelectedView should be:

    public View getSelectedView() {
        return (mCurrentBufferIndex < mLoadedViews.size() ? mLoadedViews
                .get(mCurrentBufferIndex) : null);
    }

Sorry, I'm just getting used to github, so haven't properly contributed this.

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

No branches or pull requests

2 participants