title: How to select more contacts from my contact list to send an sms
body: <p>Right now i am able to select only one contact from my contacts in my phone,i want to send sms more person in my contact list ,how can i send.</p>
  
  <p>Right now i cant add more contacts in the phone no edit text even in manually also and getting from contact list also.</p>
  
  <p>I want to send more contact number in my contact list to send an sms.what can i do</p>
  
  <pre><code>public class SendSMSActivity extends Activity {
  Button buttonSend,get;
  private static final int CONTACT_PICKER_RESULT = 1001;
  EditText phoneNo;
  EditText textSMS;
  int columnIndex_number;
  static String stringNumber;
  String sms;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.about);
      phoneNo = (EditText)findViewById(R.id.editText1);
      textSMS = (EditText) findViewById(R.id.editText2);
      get = (Button) findViewById(R.id.button1);
      get.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
               Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,
                      Contacts.CONTENT_URI);
              startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);
  
  
          }
          });
  
      Intent intent1= getIntent(); // gets the previously created intent
      final String firstKeyName = intent1.getStringExtra("firstKeyName");
  
  
      textSMS.setText(firstKeyName);
  
      buttonSend = (Button) findViewById(R.id.button2);    
      buttonSend.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v){
            try {
  
                String sms =  textSMS.getText().toString().trim();
                  Toast.makeText(getApplicationContext(), phoneNo.getText().toString()+firstKeyName,
                          Toast.LENGTH_LONG).show();
              SmsManager smsManager = SmsManager.getDefault();
              smsManager.sendTextMessage(phoneNo.getText().toString(), null, firstKeyName, 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();
            }
            finish();
  
  
          }
      });
  }
  
   @Override  
   protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
   if (resultCode == RESULT_OK) {  
      switch (requestCode) {  
      case CONTACT_PICKER_RESULT:
  
          Cursor cursor = null;  
          String phoneNumber = "";
          List&lt;String&gt; allNumbers = new ArrayList&lt;String&gt;();
          int phoneIdx = 0;
          try {  
              Uri result = data.getData();  
              String id = result.getLastPathSegment();  
              cursor = getContentResolver().query(Phone.CONTENT_URI, null, Phone.CONTACT_ID + "=?", new String[] { id }, null);  
              phoneIdx = cursor.getColumnIndex(Phone.DATA);
              if (cursor.moveToFirst()) {
                  while (cursor.isAfterLast() == false) {
                      phoneNumber = cursor.getString(phoneIdx);
                      allNumbers.add(phoneNumber);
                      phoneNo.setText(cursor.getString(phoneIdx));
  
                      cursor.moveToNext();
                  }
              } else {
                  //no results actions
              }  
          } catch (Exception e) {  
             //error actions
          } finally {  
              if (cursor != null) {  
                  cursor.close();
              } 
          }  
          break;  
      }  
  } else {
     //activity result error actions
  }  
  }
  }
  </code></pre>
  
  <p>Logcaterror its showing:</p>
  
  <pre><code>06-07 14:06:05.546: E/AndroidRuntime(780): FATAL EXCEPTION: main
  06-07 14:06:05.546: E/AndroidRuntime(780): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.jsonandroid/com.example.jsonandroid.ContactActivity}; have you declared this activity in your AndroidManifest.xml?
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.app.Activity.startActivityForResult(Activity.java:3370)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.app.Activity.startActivityForResult(Activity.java:3331)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at com.example.jsonandroid.SendSMSActivity$1.onClick(SendSMSActivity.java:42)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.view.View.performClick(View.java:4202)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.view.View$PerformClick.run(View.java:17340)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.os.Handler.handleCallback(Handler.java:725)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.os.Handler.dispatchMessage(Handler.java:92)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.os.Looper.loop(Looper.java:137)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at android.app.ActivityThread.main(ActivityThread.java:5039)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at java.lang.reflect.Method.invokeNative(Native Method)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at java.lang.reflect.Method.invoke(Method.java:511)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  06-07 14:06:05.546: E/AndroidRuntime(780):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>