title: How to focus to filtered list item using CursorAdapter in Android?
body: <p>I have a ListView which use CursorAdapter for populating its rows.It's a sorted(by using query) list view having 2 TextViews, 2 Buttons, and an ImageView. Also the screen has a 'Search' box and A-Z alphabets horizontally just above the ListView.</p>
  
  <p>I want to make tap on the A-Z alphabets will focus(scroll) the list item starting with that alphabet selected. Same for Search button also. I don't want to filter the list ,just  focus the existing item and scroll to that index.</p>
  
  <p>How can i achieve such a functionality? Here is the code snippet what I used for getting cursor starting with selected alphabet.</p>
  
  <pre><code> adapter.getFilter().filter(searchKey);
  adapter.setFilterQueryProvider(new FilterQueryProvider() {
  
                              public Cursor runQuery(CharSequence constraint) {
                                  Cursor cur = dbHelper
                                          .filterList(constraint
                                                  .toString());
  
                                  /*listView.post(new Runnable() {
  
                                      @Override
                                      public void run() {
                                          // TODO Auto-generated method stub
                                          listView.setSelection(cursor.getPosition());
                                      }
                                  });*/
  
                                  return cursor;
                              }
  
                          });
  </code></pre>
  
  <p>I don't know how to get the position of filtered cursor in the original cursor.</p>