title: Select item from drop down menu and insert in body of new message to edit
body: <p>I want to insert my drop down menu selected item in the edit text of body of new message so that i can edit the text and made necessary updates if required. My xml code for edit text is:</p>
  
  <pre><code>&lt;EditText
  android:id="@+id/editSMS"
  android:layout_width="fill_parent" 
  android:layout_height="132dp"
  android:gravity="top"
  android:inputType="textMultiLine"
  android:lines="9" /&gt;
  </code></pre>
  
  <p>code to select item from drop down menu</p>
  
  <pre><code> @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position,
              long id) {
          // On selecting a spinner item
          label = parent.getItemAtPosition(position).toString();
              // Showing selected spinner item
          Toast.makeText(parent.getContext(), "You selected: " + label,
                  Toast.LENGTH_LONG).show();
          }
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
          // TODO Auto-generated method stub
          }
  </code></pre>
  
  <p>and code for new message </p>
  
  <pre><code>editSMS = (EditText) findViewById(R.id.editSMS);
  public void onClick(View v) {
               String phoneNo = editPhoneNum.getText().toString();
               String sms = label +    editSMS.getText().toString();
               try {
                       SmsManager smsManager = SmsManager.getDefault();
                       smsManager.sendTextMessage(phoneNo, null, sms, null, null);
                       Toast.makeText(getApplicationContext(), "SMS Sent!",Toast.LENGTH_LONG).show();
  
  
               } catch (Exception e) {
                   Toast.makeText(getApplicationContext(),"SMS faild, please try again later!",Toast.LENGTH_LONG).show();
                   e.printStackTrace();
               }
          }
  </code></pre>
  
  <p>Code to load spinner data</p>
  
  <pre><code>private void loadSpinnerData() {
          // database handler
          DbHelper db = new DbHelper(getApplicationContext());
              // Spinner Drop down elements
          List&lt;String&gt; lables = db.getAllNames();
              // Creating adapter for spinner
          ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_spinner_item, lables);
              // Drop down layout style - list view with radio button
          dataAdapter
                  .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
              // attaching data adapter to spinner
          spinner.setAdapter(dataAdapter);
      }
  </code></pre>