title: How to get customer id from spinner
body: <p>This is a function that i call customer name from database for spinner. When i select the customer name, i also can obtain customer id. How to do it?</p>
  
  <pre><code> public List&lt;String&gt; getAllUsers(String userID) {
      List&lt;String&gt; userlist = new ArrayList&lt;&gt;();
      String status= "Active";
      SQLiteDatabase db = this.getReadableDatabase();
      String query = "select " + COLUMN_Customer_NAME + " from customer where " + COLUMN_Customer_USERID + "='" + userID + "'"+" AND " + COLUMN_Customer_STATUS + "='" + status + "'";
      Cursor cursor = db.rawQuery(query, null);
      if (cursor.moveToFirst()) {
          do {
              userlist.add(cursor.getString(0));
          } while (cursor.moveToNext());
      }
      cursor.close();
      db.close();
      return userlist;
  
  }
  </code></pre>