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

Crashing while choosing the last element in the basic list "DSListView" #17

Open
Umarlovesall opened this issue Mar 5, 2021 · 0 comments

Comments

@Umarlovesall
Copy link

DSListView stringDSListView;
stringDSListView = findViewById(R.id.ds_sport_list);

    ArrayList<String> al = new ArrayList<>();
    al.add("umar");
    al.add("akshay");
    al.add("arun");

    ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line,al);
    stringDSListView.setAdapter(arrayAdapter);

This is the code and following is the logcat :

java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at java.util.ArrayList.get(ArrayList.java:437)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:394)
at com.ramotion.directselect.DSListView.hideListView(DSListView.java:225)
at com.ramotion.directselect.DSListView.access$200(DSListView.java:37)
at com.ramotion.directselect.DSListView$4.run(DSListView.java:411)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7711)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

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

1 participant