Intent is a kind of message that required action immediately, while
pendingIntent is a kind of intent that will allow another application to
send the intent bound to pendingintent to send the bound intent.
For pendingIntent, let's see this code, you will understand
The sendSMS() function is defined as follows:
public class SMS extends Activity
{
//...
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
//...
}
//---sends an SMS message to another device---
private void sendSMS(String
<http://www.google.com/search?hl=en&q=allinurl%3AString+java.sun.com&btnI=I%27m%20Feeling%20Lucky>
phoneNumber, String
<http://www.google.com/search?hl=en&q=allinurl%3AString+java.sun.com&btnI=I%27m%20Feeling%20Lucky>
message)
{
PendingIntent pi = PendingIntent.getActivity(this, 0,
new Intent(this, SMS.class), 0);
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, pi, null);
}
}
Note: If you don't still understand it, please let me know, I am welcoem to
help you.
www.codemobiles.com
On Tue, Oct 27, 2009 at 9:35 PM, saurabh sinha <[email protected]> wrote:
> what is difference intent and pendingIntent in android
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---