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
0 answers

Android - PendingIntent not getting called

I am new to android, and I have been sitting here for 4 hours trying to solve this problem to no avail. The module is running on independent app, but when merging with the main app, it is not working. The code is not reaching the SendMessage…
0
votes
1 answer

Intrumented Test related to PendingIntent.getBroadcast()

I am trying to instrumented test my alarm module. In the instrumented test, I try to use and set an alarm with the system Alarm service. AlarmManager alarmMgr = (AlarmManager) …
0
votes
0 answers

Android app works on simulator but it crashes on device

My simple app in mainactivity when the button "start" is clicked, it invokes a methode of a class that extends BroadcastReceiver and this method invokes onReceive(Context context, Intent intent). The code of the method onReceive does a call phone to…
0
votes
1 answer

Android : Null PendingIntent

I am trying to create a PendingIntent for a broadcast receiver containing a notification and I am somehow getting a null PendingIntent returned. It makes no sense because there is only 1 case specified that would return a null PendingIntent and that…
0
votes
1 answer

Android notification start when ever I open app

I am adding notification to my app, Everyting is working fine if app is shut down, and it fires notification exactly as i want, but when ever i start app, and on create is called notification fires. If i leave app and start app again, notification…
NoName
  • 273
  • 7
  • 21
0
votes
2 answers

Android Opening 2 different activity from home widget by clicking different button

In my simple example app i have 2 activity: MainActivity.java NewAppWidgetConfigureActivity.java Also in my app i have class NewAppWidget.java who extends AppWidgetProvider What i want to accomplish is this: When i add home widget to screen, i…
0
votes
1 answer

Does a PendingIntent survive device restart?

Does a PendingIntent submitted to LocationServices survive device restart? If not, what's the best practice for re-submitting without requiring the user to relaunch the app?
Julian A.
  • 10,928
  • 16
  • 67
  • 107
0
votes
1 answer

How to pass an object with an Intent

I have an alarm(repeatingalarm) and BroadcastReceiver to handle it. the alarm is set in my activity with pending intent referring to BroadcastReceiver class. I have a sqlite database in my activity. i want to update my sqlite database in my alarm so…
0
votes
1 answer

Android Service scheduled with AlarmManager stops being called after a couple of days

I have been trying to schedule an Android service to run repeatedly using the AlarmManager class, but the service stops being called after a couple of days. Originally I had been using the below code to try and achieve this: Intent alarmIntent = new…
0
votes
1 answer

run an IntentService at most once

I have an IntentService and I want for the startCommand to be called only if it's not already running. The reason for this is this service is processing all existing rows in database. It can be called to start several times but if it's already…
Don Box
  • 3,166
  • 3
  • 26
  • 55
0
votes
0 answers

Service and PendingIntent

when I read the official document "Services", there are some sentences: However, if you want the service to send a result back, the client that starts the service can create a PendingIntent for a broadcast (with getBroadcast()) and deliver it to…
Sawyer
  • 45
  • 1
  • 6
0
votes
1 answer

Getting 'E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 9448080)' while trying to build a notification

I'm trying to build a notification and receive it after an interval of time. Here's how: futureInMillis = SystemClock.elapsedRealtime() + 176000; Intent notificationIntent = new Intent(getBaseContext(),…
0
votes
1 answer

Navigating push notification will close intermediate activity when back press navigated activity android

I'm navigating to activity C when clicking push notification. Where activity A is my home screen and I'm currently in activity B from activity A while receiving a push notification. Consider now I'm receiving a push notification and clicking the…
0
votes
1 answer

How should I use PendingIntent to make a second call?

I would like to make two calls in a row in an android app. Upon clicking button the app calls the first number. I created the broadcastreceiver below, that detects when the first call ends. It should write out that "First call ended" and then call…
0
votes
2 answers

Maintain list of PendingIntents, persist past owning object's lifecycle

I have a data object which occasionally gets refreshed from a data source on the web using a recurring alarm. This data object has keeps track of objects which want to be notified when it gets new data. I currently use two means to register…
rothloup
  • 1,220
  • 11
  • 29