title: Spinner Prompt Displays Package Name Instead Of Prompt
body: <p>This is a weird problem I am facing. The data comes from the SQLite database. It displays package name: <code>com.dzinesunlimited.foodzines.free.Administration.Menu.MenuAdministrationActivity</code> instead of "<em>CHOOSE A CATEGORY</em>" (Defined in the <code>strings.xml</code>). The Spinner is defined in the XML:</p>
  
  <pre><code>&lt;Spinner
      android:id="@+id/spnDishCategory"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginLeft="11dp"
      android:layout_marginRight="11dp"
      android:popupBackground="@color/panel_medium"
      android:prompt="@string/menu_admin_category_spinner_prompt" &gt;
  &lt;/Spinner&gt;
  </code></pre>
  
  <p>This is the Java code:</p>
  
  <pre><code>MenuAdministratorCategoryAdapter adapMenuCategories = new MenuAdministratorCategoryAdapter(
      getActivity(), 
      android.R.layout.simple_spinner_item, 
      arrMenuCategory);
  
  spnDishCategory.setOnItemSelectedListener(new OnItemSelectedListener() {
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parentView, View v, int position, long id) {
  
          if (position != -0) {
              String strMenucategory = arrMenuCategory.get(position).getCatID();
              SELECTED_CATEGORY_ID = strMenucategory;
              Log.e("CAT ID", SELECTED_CATEGORY_ID);
              Toast.makeText(getActivity(), String.valueOf(position), Toast.LENGTH_SHORT).show();
  
              /** CLEAR THE CURRENT GRIDVIEW AND THE ARRAYADAPTER **/
              gridDishes.invalidate();
              adapter.notifyDataSetChanged();
              arrDishes.clear();
  
              /** CHANGE THE PROMPT **/
              spnDishCategory.setPrompt(arrMenuCategory.get(position).getCatName());
  
              /** FETCH THE MENUS IN THE SELECTED CATEGORY **/
              new fetchMenusInTheCategory().execute();
  
              /* INSTANTIATE THE ADAPTER */
              adapter = new MenuAdministrationAdapter(getActivity(), arrDishes);
          }
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; parentView) {
  
      }
  });
  </code></pre>
  
  <p>This is the <code>AsyncTask</code> that fetches the data from the database:</p>
  
  <pre><code>private class loadMenuCategories extends AsyncTask&lt;Void, Void, Void&gt;    {
  
      /** AN INTEGER INSTANCE TO HOLD THE TOTAL NUMBER OF ITEMS RETURNED BY THE DATABASE **/
      int intMenuCategories;
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
  
          // CONSTRUCT THE QUERY TO FETCH ALL TWEETS FROM THE DATABASE
          String strQueryData = "SELECT * FROM categories";
  
          // CAST THE QUERY IN THE CURSOR TO FETCH THE RESULTS
          cursor = db.selectAllData(strQueryData);
          intMenuCategories = cursor.getCount();
      }
  
      @Override
      protected Void doInBackground(Void... params) {
  
          if (intMenuCategories &gt; 0)  {
  
              if (cursor != null &amp;&amp; cursor.getCount() != 0)   {
  
                  /* AN INSTANCE OF THE MenuAdministratorCategoryData HELPER CLASS */
                  MenuAdministratorCategoryData menuCategory;
  
                  for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
  
                      /***** INSTANTIATE THE MenuAdministratorCategoryData INSTANCE "menuCategory" *****/
                      menuCategory = new MenuAdministratorCategoryData();
  
                      /** GET THE CATEGORY ID **/
                      if (cursor.getString(cursor.getColumnIndex(db.CATEGORY_ID)) != null)    {
                          String strCatID = cursor.getString(cursor.getColumnIndex(db.CATEGORY_ID));
                          menuCategory.setCatID(strCatID);
                      } else {
                          String strCatID = null;
                          menuCategory.setCatID(strCatID);
                      }
  
                      /** GET THE CATEGORY NAME **/
                      if (cursor.getString(cursor.getColumnIndex(db.CATEGORY_NAME)) != null)  {
                          String strCatName = cursor.getString(cursor.getColumnIndex(db.CATEGORY_NAME));
                          menuCategory.setCatName(strCatName);
                      } else {
                          String strCatName = null;
                          menuCategory.setCatName(strCatName);
                      }
  
                      /** ADD THE COLLECTED DATA TO THE ARRAYLIST **/
                      arrMenuCategory.add(menuCategory);
                  }
              }
  
          }
  
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          super.onPostExecute(result);
  
          // CLOSE THE CURSOR
          if (cursor != null &amp;&amp; !cursor.isClosed())   {
              cursor.close();
          }
  
          // CLOSE THE DATABASE
          db.close();
  
          // SET THE ADAPTER TO THE GRIDVIEW
          spnDishCategory.setAdapter(adapMenuCategories);
  
          new showDefaultMenuCategory().execute();
      }
  
  }
  </code></pre>
  
  <p>This is the adapter:</p>
  
  <pre><code>public View getDropDownView(int position, View convertView, ViewGroup parent) {
  
      View row = convertView;
  
      if (row == null)    {
          row = inflater.inflate(R.layout.menu_fragment_category_spn_row, parent, false);
      }
  
      TextView txtCategoryCode = (TextView) row.findViewById(R.id.txtCategoryCode);
      Typeface fntCategoryCode = Typeface.createFromAsset(activity.getAssets(), "fonts/RobotoCondensed-Regular.ttf");
      txtCategoryCode.setTypeface(fntCategoryCode);
  
      /** SET THE CATEGORY NAME **/
      String strCatName = arrMenuCategory.get(position).getCatName();
      if (strCatName != null) {
          txtCategoryCode.setText(strCatName);
      }
  
      return row;
  }
  </code></pre>
  
  <p>How it looks:
  <img src="https://i.stack.imgur.com/4VDh1.png" alt="enter image description here"></p>
  
  <p>Any help is appreciated helping me fix this problem.</p>
  
  <p>P.S.: If any other code is needed, please let me know.</p>
  
  <p><strong>EDIT</strong>: Almost forgot. This is a custom Spinner. The custom layout for the row is:</p>
  
  <p><strong>menu_fragment_category_spn_row.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/txtCategoryCode"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:background="#ff171717"
      android:gravity="left|center"
      android:maxLines="1"
      android:padding="11dp"
      android:text="INVENTORY CATEGORY CODE"
      android:textColor="#F9F9F9"
      android:textSize="18sp" &gt;
  
  &lt;/TextView&gt;
  </code></pre>