title: Android: How to populate Spinner view from a cursor without having to use @SuppressWarnings("deprecation") on the SimpleCursorAdapter constructor
body: <p>I have a Spinner bound to a database column by a cursor. All the examples I have found suggest the use of the <code>SimpleCursorAdapter</code> which apparently is deprecated, so i have to use <code>@SuppressWarnings("deprecation)</code> in order to complile correctly. I have the following code that works correctly, but I don't like having to use a deprecated feature.</p>
  
  <pre><code>private Spinner  itemCategory;
  itemCategory    = (Spinner) findViewById(R.id.itemCategory);
  
  private void loadCategoryOptions() {
  
      Uri uri                     = Uri.parse(GoalsContentProvider.CONTENT_URI + "/categories");
      String[] projection         = { CategoriesTable.COLUMN_ID, CategoriesTable.COLUMN_NAME };
      String selectCriteria       = CategoriesTable.COLUMN_STATUS + " &gt; 0";
      String sortOrder            = CategoriesTable.COLUMN_NAME + " ASC";
      Cursor cursor               = managedQuery(uri, projection, selectCriteria, null, sortOrder);
  
      @SuppressWarnings("deprecation")
      SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, 
                                                            android.R.layout.simple_spinner_item, 
                                                            cursor, new String[] { CategoriesTable.COLUMN_NAME },  
                                                            new int[] {android.R.id.text1});
  
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      itemCategory.setAdapter(adapter);
  }
  </code></pre>
  
  <p>I am using the Android support v4 package. Any suggestions?</p>