Trying to catch a click on android ListView item: android:descendantFocusability=”blocksDescendants” not working

Try using this inside each button layouts android:focusable=”false” android:focusableInTouchMode=”false” and remove other thing which you are doing for this. Also from listview. Also remove this android:descendantFocusability=”blocksDescendants” and this too parent.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS); ((ViewGroup) v).setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);

mvvm how to make a list view auto scroll to a new Item in a list view

This solution is for a ListBox, but it could be modified for a ListView… This will scroll the selected item into view when you change the selected item from the ViewModel. Class: /// <summary> /// ListBoxItem Behavior class /// </summary> public static class ListBoxItemBehavior { #region IsBroughtIntoViewWhenSelected /// <summary> /// Gets the IsBroughtIntoViewWhenSelected value /// … Read more

How to text filter an Android ListView backed by a SimpleCursorAdapter?

For a SimpleCursorAdapter cursor, you only need to use the setFilterQueryProvider, to run another query for your cursor, based on the constraint: m_Adapter.setFilterQueryProvider(new FilterQueryProvider() { public Cursor runQuery(CharSequence constraint) { Log.d(LOG_TAG, “runQuery constraint:”+constraint); //uri, projection, and sortOrder might be the same as previous //but you might want a new selection, based on your filter content … Read more

List view snap to item

I’ve found a way to do this just listening to scroll and change the position when the scroll ended by implementing ListView.OnScrollListener @Override public void onScrollStateChanged(AbsListView view, int scrollState) { switch (scrollState) { case OnScrollListener.SCROLL_STATE_IDLE: if (scrolling){ // get first visible item View itemView = view.getChildAt(0); int top = Math.abs(itemView.getTop()); // top is a negative … Read more