How to get all extra values from intent
<p>Here is my code</p>

<pre><code>     Log.i("sdfgsdf", time.toGMTString());
        String SENT = "SMS_SENT";
        Intent y=  new Intent(SENT);
        y.putExtra("number", phoneNumber);
        y.putExtra("time", time.toString());

        String DELIVERED = "SMS_DELIVERED";
        int FLAG_UPDATE_CURRENT =(0x08000000) ;
        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
        y, FLAG_UPDATE_CURRENT);

        PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,
        new Intent(DELIVERED), FLAG_UPDATE_CURRENT);

        //---when the SMS has been sent---
        r=  new BroadcastReceiver(){
            @Override
             public void onReceive(Context arg0, Intent arg1) {

                switch (getResultCode())
                {

                    case Activity.RESULT_OK:
                        Toast.makeText(getBaseContext(), "SMS sent"+arg1.getStringExtra("number"), 
                                Toast.LENGTH_SHORT).show();
                        Constant.DB = Compose.this.openOrCreateDatabase("Indigo",MODE_PRIVATE, null);
                        Constant.DB.execSQL("UPDATE Message SET IsMsgSent='true' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.execSQL("UPDATE Message SET FolderId='5' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.close();
                      //  unregisterReceiver(r);
                        break;
                    case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                        Toast.makeText(getBaseContext(), "Generic failure"+arg1.getStringExtra("number"), 
                                Toast.LENGTH_SHORT).show();
                        Constant.DB = Compose.this.openOrCreateDatabase("Indigo",MODE_PRIVATE, null);
                        Constant.DB.execSQL("UPDATE Message SET IsMsgSent='false' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.close();
                       // unregisterReceiver(r);
                        break;
                    case SmsManager.RESULT_ERROR_NO_SERVICE:
                        Toast.makeText(getBaseContext(), "No service"+arg1.getStringExtra("number"), 
                                Toast.LENGTH_SHORT).show();
                        Constant.DB = Compose.this.openOrCreateDatabase("Indigo",MODE_PRIVATE, null);
                        Constant.DB.execSQL("UPDATE Message SET IsMsgSent='false' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.close();
                       // unregisterReceiver(r);
                        break;
                    case SmsManager.RESULT_ERROR_NULL_PDU:
                        Toast.makeText(getBaseContext(), "Null PDU"+arg1.getStringExtra("number"), 
                                Toast.LENGTH_SHORT).show();
                        Constant.DB = Compose.this.openOrCreateDatabase("Indigo",MODE_PRIVATE, null);
                        Constant.DB.execSQL("UPDATE Message SET IsMsgSent='false' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.close();
                      //  unregisterReceiver(r);
                        break;
                    case SmsManager.RESULT_ERROR_RADIO_OFF:
                        Toast.makeText(getBaseContext(), "Radio off"+arg1.getStringExtra("number"), 
                        Toast.LENGTH_SHORT).show();
                        Constant.DB = Compose.this.openOrCreateDatabase("Indigo",MODE_PRIVATE, null);
                        Constant.DB.execSQL("UPDATE Message SET IsMsgSent='false' where DateAndTime='" + arg1.getStringExtra("time") + "' and ContactNumber='"+arg1.getStringExtra("number")+"'");
                        Constant.DB.close();
                      //  unregisterReceiver(r);
                        break;
                }

            }

        };
        registerReceiver(r, new IntentFilter(SENT));

        //---when the SMS has been delivered---
        registerReceiver(new BroadcastReceiver(){
            @Override
            public void onReceive(Context arg0, Intent arg1) {
                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();
                        break;                        
                }
            }
        }, new IntentFilter(DELIVERED));        

        SmsManager sms = SmsManager.getDefault();
        sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);        
</code></pre>

<p>And when i send multiple sms using a for loop iam getting extras of only last sent sms.how to get all extras..?</p>
