Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:28:33+00:00 2026-05-24T05:28:33+00:00

Here is my code Log.i(sdfgsdf, time.toGMTString()); String SENT = SMS_SENT; Intent y= new Intent(SENT);

  • 0

Here is my 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);        

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:28:34+00:00Added an answer on May 24, 2026 at 5:28 am

    Calling intent place do it like this

        Bundle bundle = new Bundle();
    bundle.putString("RetailerName", keyword);
    bundle.putString("positon", aString);
    intent.putExtras(bundle);
    

    receive intent place get the data like this

      Bundle bundle = this.getIntent().getExtras();
      String RetailerName = bundle.getString("retailerName");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code: var showNo = 1; window.setInterval(function() { console.log(showNo); if(showNo === 1)
Here is My Code To Log In var expire = DateTime.Now.AddDays(7); // Create a
I paste some piece of my code here: public void onCreate(Bundle savedInstanceState) { Log.e(Main
I'm making a Grade log application and I have this piece of code here
Given: function foo(){ var bar = quux; console.log(/*mystery code here*/); } I'm looking for
I found this snippet of code here that allows you to log into a
I am trying to log in to a site using CookieAwareClient (code here: C#
Here is the code: <script> document.getElementById('btn').addEventListener('mousedown',(function(){ console.log('code'); })); </script> <input id=btn type=button onmousedown=console.log('button')> Which
log warning: implicit declaration of function 'TutorialAlertWithMessageAndDelegate' here my code .h void TutorialAlertWithMessageAndDelegate(NSString *title,
Here my code snippet: query.next(); qDebug()<<query.lastError(); qlonglong res=query.value(0).toLongLong(); qDebug()<<query.lastError(); and the corresponding log I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.