Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Get SMS
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ehsan Sadeghi  
View profile  
 More options Aug 11 2012, 12:47 pm
From: Ehsan Sadeghi <esade...@gmail.com>
Date: Sat, 11 Aug 2012 09:47:17 -0700 (PDT)
Local: Sat, Aug 11 2012 12:47 pm
Subject: Get SMS

I create an activity
  <activity
            android:name=".GetResponse"

                       android:label="@string/title_activity_main"  
android:launchMode="singleTask">
            <intent-filter>
                <action android:name="ir.smspeik.sms.getresponse" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
               that starts when a sms received. i write this code to
display sms but nothing is shown :
public class GetResponse extends Activity{
    IntentFilter intentFilter;    
    private BroadcastReceiver intentReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            //---display the SMS received in the TextView---
            //TextView SMSes = (TextView) findViewById(R.id.textView1);
            Toast.makeText(context, intent.getExtras().getString("sms") +
"Ehsan",
                Toast.LENGTH_SHORT).show();
            String[] sms = intent.getExtras().getString("sms").split("-");
            EditText smsNo = (EditText) findViewById(R.id.txtSmsNo);
            smsNo.setText(sms[0]);
            Toast.makeText(context,sms[0],
                        Toast.LENGTH_SHORT).show();
            TextView smsBody = (TextView) findViewById(R.id.lblSmsBody);
            smsBody.setText(sms[1]);
            Toast.makeText(context,sms[1],Toast.LENGTH_SHORT).show();
        }
    };

     @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.getresponse);
          intentFilter = new IntentFilter();
            intentFilter.addAction("SMS_RECEIVED_ACTION");

            //---register the receiver---
            registerReceiver(intentReceiver, intentFilter);
        }
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.