PendingIntent was added in API Level 1
A description of an Intent and target action to perform with it. Instances of this class are created with getActivity(Context, int, Intent, int), getActivities(Context, int, Intent[], int),getBroadcast(Context, int, Intent, int), and getService(Context, int, Intent, int); the returned object can be handed to other applications so that they can perform the action you described on your behalf at a later time.
1. In the MainActivity.java file, add the below line to the import section.
import android.app.PendingIntent;
2. Add the below line to the onCreate method. This will declare a PendingIntent named myPendingIntent.
PendingIntent myPendingIntent;
3. Compile and run!
Next Recommended Article: How to Set a PendingIntent with getActivity
Resources:
http://developer.android.com/reference/android/app/PendingIntent.html
Popular Posts
- android:ellipsize - Add an ellipsis(...) in a TextView
- Save LogCat to a Text File
- android:typeface - Set the Typeface to Sans, Serif, or Monospace in a TextView/EditText
- Perform an Action after Enter keypress on EditText
- android:layerType
- How to Get Current Time in Milliseconds
- Capitalize Text in a TextView, using inputType
- Intent setType(String type) - How to Set an Explicit MIME data type
- android:alpha - Set the Opacity/Transparency of Text in TextView/EditText
- Deprecated: android:singleLine - Set a TextView to 1 Line with ellipsis(...) at end