Hi! I'd like to get an opinion, whether filtering a listview with a SearchView inside ActionBar is a bad practice or not?
I've already implemented it, and now I see all of the issues I have to deal with manually, in order to get a consistent experience. Problems are more visible when using a "two-pane" layout, with listview on the left and details view on the right (like Gmail app on a tablet). The problems I've encountered: 1) The LinearLayout I'm using for list item is a special type, which supports "checked" property, so I can use a backwards-compatible background (drawable selector) to indicate the "selected" state (which item in a list view is currently selected, and for which item the details (in the right fragment) are shown. The problem is, that when filtering the listview (using the adapter.getFilter().filter(query)), the items get filtered, but the views are not being redrawn, meaning that the selected row stays in a selected state, although the underlying data changes. I didn't find an event that gets fired for such changes yet, but I'm sure there is something I can find to fix it. 2) I would need to "erase" the detail view (fragment) when nothing is selected - for search input I looked at "stock" applications - how do they deal with it. Interestingly enough: a) gmail app starts a new activity when performing search b) play store starts a new activity when performing search c) calendar app starts a new activity when performing search d) stock email app starts a new activity when performing search whereas e) contacts (People) app, filters the list inline, the way I've implemented, only they handle selections correctly. What do you guys (and gals) think? Does real-time filtering make sense, provided that the data is already in the memory (which is my case)? And to submit the "filter query" to a separate activity when the searching (filtering) process is a lenghty one and possibly includes network I/O? Regards, Miha. -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

