title: How to set default value to spinner dropdown in Android?
body: <p>I need to set the default value text <strong>"select your Device"</strong> value to my spinner drop-down list, I put it as list item so it acts as a drop-down list items and I hide the drop-down list, because of that I’m getting a blank space in my drop-down.</p>
  
  <p>How should I do this?</p>
  
  <p><a href="https://i.stack.imgur.com/DQTRG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DQTRG.png" alt="Image"></a></p>
  
  <p>this is the code I’m used</p>
  
  <pre><code>mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
          setSupportActionBar(mToolbar);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
          getSupportActionBar().setDisplayShowTitleEnabled(false);
  
          /*Setup a Spinner*/
          mToolbarSpinner = (Spinner) findViewById(R.id.spinner_toolbar);
  
          /*Manage the spinner*/
          mToolbarSpinnerNavigationItems = new ArrayList&lt;SpinnerNavItem&gt;();
  
          mToolbarSpinnerNavigationItems.add(new SpinnerNavItem("Select your Seebo", R.drawable.deviceonline));
  
          /*setting the mToolbarSpinnerNavigationItems to list_item_title_navigation.xml*/
          mArrayAdapter = new ArrayAdapter(this, R.layout.list_item_title_navigation,mToolbarSpinnerNavigationItems){
              @Override
              public View getView(int position, View convertView, ViewGroup parent) {
  
                  // remember to inflate custom layout for spinner item
                  // then set anything you want here
                  // remember to use convertView.findViewById(), not just findViewById()
  
                  // this is an example
                  // inflate layout
                  convertView = View.inflate(MainActivity.this, R.layout.list_item_title_navigation, null);
                  // get view
                  TextView tvText1 = (TextView) convertView.findViewById(R.id.devicetitle);
                  ImageView imgIcon = (ImageView) convertView.findViewById(R.id.deviceicon);
                  imgIcon.setVisibility(View.GONE);
                  //imgIcon.setImageResource(mToolbarSpinnerNavigationItems.get(position).getIcon());
                  // set content
                  tvText1.setText(mToolbarSpinnerNavigationItems.get(position).getTitle());
                  // return
                  return convertView;
              }
  
              @Override
              public View getDropDownView(int position, View convertView, ViewGroup parent) {
  
                  return convertView;
              }
  
          };
  
          //setting adapter to Spinner
          mToolbarSpinner.setAdapter(mArrayAdapter);
  </code></pre>