title: How to pass String(phone number) for Quickreply? :D
body: <p>I have a problem(again)...now i want to pass a String from one Activity to another.</p>
  
  <p>The first Activity is SMSReceiver, i make a ListView for contact's number and message's here.</p>
  
  <p>This is the complete code :</p>
  
  <pre><code>public class SMSReceiver extends BroadcastReceiver {
  
  private static final int NOTIF_ID = 0;
  
  @Override
  public void onReceive(Context arg0, Intent arg1) {
      // TODO Auto-generated method stub
  
      Bundle bundle = arg1.getExtras();
      SmsMessage[] msgs = null;
      String str = "";
      if (bundle != null) {
          Object[] pdus = (Object[]) bundle.get("pdus");
          msgs = new SmsMessage[pdus.length];
  
          for (int i = 0; i &lt; msgs.length; i++) {
              msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
              str += "You Get New SMS from " + msgs[i].getOriginatingAddress();
              str += " :";                    str += msgs[i].getMessageBody().toString();
              str += "\n";
  
          Toast.makeText(arg0, str, Toast.LENGTH_SHORT).show();
  
          NotificationManager nm = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE);
  
          String tickerText = str;
  
          Notification notif = new Notification(R.drawable.ic_launcher, tickerText, System.currentTimeMillis());
  
          notif.flags = Notification.FLAG_AUTO_CANCEL;
  
          String contentTitle = msgs[i].getOriginatingAddress();
          String contentText = msgs[i].getMessageBody().toString();
  
          Intent intent = new Intent(arg0, SMSReply.class);
          PendingIntent pi = PendingIntent.getActivity(arg0, 0, intent, 0);
  
          notif.setLatestEventInfo(arg0, contentTitle, contentText, pi);
          notif.defaults = Notification.DEFAULT_ALL;
          nm.notify(NOTIF_ID, notif);
  
          String tempSMS = msgs[i].getOriginatingAddress();
          Intent pass = new Intent();
          Bundle bundlePass = new Bundle();
  
          bundlePass.putString("key", tempSMS);
          pass.putExtras(bundlePass);
          }
      }
  }
  </code></pre>
  
  <p>And this is the PART OF SMSReceiver that i used for passing a String via Bundle and Intent </p>
  
  <pre><code>String tempSMS = msgs[i].getOriginatingAddress();
          Intent pass = new Intent();
          Bundle bundlePass = new Bundle();
  
          bundlePass.putString("key", tempSMS);
          pass.putExtras(bundlePass);
  </code></pre>
  
  <p>Now, this is the complete SMSReply Class, the class that i want to get a phone number(String) from SMSReceiver Class(so user don't have to type it again)</p>
  
  <pre><code>public class SMSReply extends Activity implements OnClickListener {
  
  EditText etPhone, etMessage;
  Button bSend;
  String phone, message;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.reply);
  
      etPhone = (EditText) findViewById(R.id.etPhone);
      etMessage = (EditText) findViewById(R.id.etMessage);
      bSend = (Button) findViewById(R.id.bSend);
      bSend.setOnClickListener(this);
  }
  
  public void onClick(View arg0) {
      // TODO Auto-generated method stub
      Intent get = new Intent();
  
      Bundle bundleGet = get.getExtras();
      phone = bundleGet.getString("answer");
      etPhone.setText(phone);
  
      phone = etPhone.getText().toString();
      message = etMessage.getText().toString();
  
      if (phone.length() &gt; 0 &amp;&amp; message.length() &gt; 0) {
          sendSms(phone, message);
      } else {
          Toast.makeText(getBaseContext(),
                  "Please enter both phone number and message",
                  Toast.LENGTH_SHORT).show();
      }
  }
  
  private void sendSms(String phone2, String message2) {
      // TODO Auto-generated method stub
      String SENT = "SMS_SENT";
      String DELIVERED = "SMS_DELIVERED";
  
      PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(
              SENT), 0);
      PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,
              new Intent(DELIVERED), 0);
  
      registerReceiver(new BroadcastReceiver() {
  
          @Override
          public void onReceive(Context arg0, Intent arg1) {
              // TODO Auto-generated method stub
              switch (getResultCode()) {
              case Activity.RESULT_OK:
                  Toast.makeText(getBaseContext(), "SMS sent",
                          Toast.LENGTH_SHORT).show();
                  break;
              case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                  Toast.makeText(getBaseContext(), "Generic Failure",
                          Toast.LENGTH_SHORT).show();
                  break;
              case SmsManager.RESULT_ERROR_NO_SERVICE:
                  Toast.makeText(getBaseContext(), "No Service",
                          Toast.LENGTH_SHORT).show();
                  break;
              case SmsManager.RESULT_ERROR_NULL_PDU:
                  Toast.makeText(getBaseContext(), "Null PDU",
                          Toast.LENGTH_SHORT).show();
                  break;
              case SmsManager.RESULT_ERROR_RADIO_OFF:
                  Toast.makeText(getBaseContext(), "Radio Off",
                          Toast.LENGTH_SHORT).show();
                  break;
              }
          }
      }, new IntentFilter(SENT));
  
      registerReceiver(new BroadcastReceiver() {
  
          @Override
          public void onReceive(Context context, Intent intent) {
              // TODO Auto-generated method stub
              switch (getResultCode()) {
              case Activity.RESULT_OK:
                  Toast.makeText(getBaseContext(), "SMS Delivered",
                          Toast.LENGTH_SHORT).show();
                  break;
              case Activity.RESULT_CANCELED:
                  Toast.makeText(getBaseContext(), "SMS not Delivered",
                          Toast.LENGTH_SHORT).show();
              }
          }
      }, new IntentFilter(DELIVERED));
      SmsManager sms = SmsManager.getDefault();
      sms.sendTextMessage(phone, null, message, sentPI, deliveredPI);
  }
  </code></pre>
  
  <p>And this is the PART OF SMSReply class, where i put some code's for taking a String from SMSReceiver and set that String in my EditText :D</p>
  
  <pre><code>Intent get = new Intent();
  
      Bundle bundleGet = get.getExtras();
      phone = bundleGet.getString("answer");
      etPhone.setText(phone);
  
      phone = etPhone.getText().toString();
      message = etMessage.getText().toString();
  </code></pre>
  
  <p>Thats All!
  Please help me, and thank you very much! :D</p>
  
  <p>PS : Sory for the long post, and sory if my English is not good, English is not my native languange :D</p>