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

Operations on checked items does not take database modifications into account #1005

Closed
2 tasks
daniele-athome opened this issue May 23, 2017 · 0 comments
Closed
2 tasks
Assignees
Labels
bug Something isn't working
Milestone

Comments

@daniele-athome
Copy link
Member

daniele-athome commented May 23, 2017

This is because the SparseArray could be outdated if the dialog button is clicked after a modification (e.g. a new thread is created). The stacktrace below doesn't exactly reflect that (because the database is empty, but who knows), anyway the problem is there and should be fixed: take all message or thread ids and store them in a data structure to be used in the dialog callback.

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
       at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
       at java.util.ArrayList.get(ArrayList.java:308)
       at android.widget.HeaderViewListAdapter.getItem(HeaderViewListAdapter.java:185)
       at android.widget.AdapterView.getItemAtPosition(AdapterView.java:764)
       at org.kontalk.ui.AbstractComposeFragment$3.onClick(AbstractComposeFragment.java:565)
       at com.afollestad.materialdialogs.MaterialDialog.onClick(MaterialDialog.java:367)
       at android.view.View.performClick(View.java:4438)
       at android.view.View$PerformClick.run(View.java:18440)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5034)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
       at dalvik.system.NativeStart.main(NativeStart.java)
  • delete threads
  • delete messages
@daniele-athome daniele-athome added the bug Something isn't working label May 23, 2017
@daniele-athome daniele-athome added this to the 4.0.4 milestone May 23, 2017
@daniele-athome daniele-athome self-assigned this Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant