Questions tagged [android-pendingintent]

An Android class that provides a description of an Intent and target action to perform with it

From the PendingIntent API:

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.

By giving a PendingIntent to another application, you are granting it the right to perform the operation you have specified as if the other application was yourself (with the same permissions and identity). As such, you should be careful about how you build the PendingIntent: often, for example, the base Intent you supply will have the component name explicitly set to one of your own components, to ensure it is ultimately sent there and nowhere else.

Useful links

1881 questions
0
votes
1 answer

notification buttons (.addaction) not launching activity

I'm attempting to make a notification that has two buttons which do two different things by running two different activities. The notification and its buttons appear on the notification bar fine, however pressing on either of the buttons fails to…
James
  • 67
  • 1
  • 10
0
votes
1 answer

Android: How to create multiple alarms and cancel them after select

I wanted to create a few number of alarms which has different times and canceled them one by one when I select each. I could create few alarms. But I have no idea how to cancel them when I select. Currently, alarm canceling process is working for…
0
votes
1 answer

Move to other activity when doing AsyncTask

private class MyTask extends AsyncTask { int number; private String content = null; private boolean error = false; Context mContext; int NOTIFICATION_ID = 1; Notification mNotification; …
0
votes
0 answers

Android repeating Alarm doesn't trigger at the set interval

I have seen many questions like this in SO. but I didn't get the correct answer. I want an alarm to trigger at every 2 minutes after I press a button. So I set an alarm to do so and I set the interval to 3 seconds so that I can observe that my code…
0
votes
0 answers

Android Notification arrives only when device is usb debug attached

I have exactly the same problem.Android Notifications triggered by pending intent works perfectly when device is attached with debugger but does not works after remove.The solution given in that problem does not works for me. Code public class…
shuvo
  • 91
  • 1
  • 2
  • 5
0
votes
0 answers

Checking pending intent availablity status not working

Am trying to getting pending intent. Its returning intent fine when i click notification. But it not returning any thing when i open my app through launcher icon its not returning the pending intent. I searched many links but am not get…
user2634966
  • 179
  • 1
  • 16
0
votes
3 answers

Android notification onclick

I was wondering how to implement the onClickListener for an android notification. I am trying to implement sendText() in the notification instead of sending the user to the main activity: public class AlertReceiver extends BroadcastReceiver { …
Tal C
  • 547
  • 1
  • 8
  • 17
0
votes
1 answer

BroadcastReceiver's onReceive() is failing to receive the broadcast sent by another BroadcastReceiver

I have a Service from where I send a broadcast intent to a BroadcastReceiver and then this broadcast receiver sends it back to a BroadcastReceiver specified inside the Service. Here's the code: private Notification getNotificationAU() { …
0
votes
1 answer

PendingIntent does not create intent chooser

I am using Chrome custom tabs to open URL in my application. I am trying to configure Share feature in its action button which requires PendingIntent as one of its arguments. I am returning the PendingIntent as follows: private static PendingIntent…
Bhoot
  • 2,614
  • 1
  • 19
  • 36
0
votes
0 answers

Cancel pending intent with FLAG_UPDATE_CURRENT

I have set a PendingIntent with UPDATE_CURRENT_FLAG, when i cancelled it, i try to check PendingIntent instance (current pending intent) with FLAG_NO_CREATE flag, but the result doesn't return null, please tell me how to fix it. Thank You
0
votes
1 answer

How do you separate an Android App Widget Activity stack from the Application Activity stack?

I've got an Android App Widget that when clicked uses a PendingIntent to start an Activity, which the main Application associated with the App Widget also uses. After the user is done with the Activity started from the App Widget, and presses the…
0
votes
1 answer

Android gcm notification open fragment

When I click, The fragment doesn't open. What am I doing wrong? This is my gcm code. I don't see any error in log chat. The notification works, I think there is not any problem. Can anyone help me with this issue ? protected void…
0
votes
1 answer

Start application after crash

I want to restart my application after crash. So I created a crash handler on Application class: public final class MyApp extends Application { private static Thread.UncaughtExceptionHandler mDefaultUEH; private…
cimenmus
  • 1,386
  • 4
  • 18
  • 31
0
votes
1 answer

Pass data to activity started by service

I've been trying to make an alarm app using a WakefulBroadcastReceiver, which starts a wakeful service (IntentService) that starts up SecondActivity (alarm is set in MainActivity). However, I haven't been able to figure out how to pass data from…
0
votes
1 answer

Why PendingIntent opens the launcher activity of the app rather than specific activity?

I am using firebase to send notification. It will open ResultActivity when user click on notification. It is working fine when app is in foreground. But when app is in background, it open the HomeActivity (which is the launcher activity of the app)…