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

Changing DisplayedValues can cause a crash. #158

Closed
VincentSit opened this issue Dec 29, 2019 · 1 comment
Closed

Changing DisplayedValues can cause a crash. #158

VincentSit opened this issue Dec 29, 2019 · 1 comment

Comments

@VincentSit
Copy link

Changing DisplayedValues to a shorter array, and then changing to a longer array, will certainly cause a crash.

Add the following code to the simple to reproduce the bug.

...
// Set string values
        String[] data = {"A", "B", "C", "D", "E", "F", "G", "H", "I"};
        numberPicker.setMinValue(1);
        numberPicker.setMaxValue(data.length);
        numberPicker.setDisplayedValues(data);

        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                String[] data = {"W", "Y", "Z"};
                numberPicker.setMinValue(1);
                numberPicker.setMaxValue(data.length);
                numberPicker.setDisplayedValues(data);

                final Handler handler = new Handler();
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        String[] data = {"A", "B", "C", "D", "E", "F", "G", "H", "I"};
                        numberPicker.setMinValue(1);
                        numberPicker.setMaxValue(data.length);
                        numberPicker.setDisplayedValues(data);
                    }
                }, 2000);
            }
        }, 2000);
...
@ShawnLin013
Copy link
Owner

Fixed at v2.4.9.

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

2 participants