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

Compare two pendingIntent

I have to compare 2 PendingIntent for delete proximityAlert before create another, because it seems not work. I have in my function: SharedPreferences pref = getSharedPreferences("proximityService", Context.MODE_PRIVATE); int unique_id…
LorenzoBerti
  • 6,704
  • 8
  • 47
  • 89
0
votes
1 answer

How to set an Alarm in an Android App based on a server's current time?

I am building an Android application that sets an alarm based on my application's server time. By comparing GMT and application server time am trying to create an alarm. for example: GMT = 10.30 am and server time = 4.30 am, so i need to set alarm…
0
votes
1 answer

Executing Code in system process

i like to know is there way to execute code in system app process in android. i found through pending intent we can assign our job to execute in foreign application like alarm manager or notification but still i found job gets execute in same…
0
votes
2 answers

Android cancelling pending intent not working

I am facing this really weird problem. I have made a working alarm system. But when I delete the alarm, it calls it. AlarmBuddy.java (Working class to set original alarm) Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MONTH,…
0
votes
0 answers

Android opening two activities simultaneously have race conditions

Hi I am developing android application in which I have one base activity(BaseActvitity B).My activity which I start from notification pending intent (Activity A) extends activity B. In activity B I have override onUserInteraction() in following way:…
nilkash
  • 7,408
  • 32
  • 99
  • 176
0
votes
1 answer

Notification is triggered again and again

I am creating a notification on a activity called Mainmenu using alarm here is code Intent myIntent = new Intent(MainMenu.this, SyncService.class); AlarmManager alarmManager = (AlarmManager)context.getSystemService(ALARM_SERVICE); pendingIntent =…
0
votes
1 answer

AlarmManager not from MainActivity

When i create AlarmManager inside MainActivity it works as it should. Another activity starts at a specified time: AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); Intent intent = new Intent(MainActivity.this,…
0
votes
1 answer

How does setting repeating alarm affects on calling in the onCreate()

If I call the setinexactrepeating() alarm method in the onCreate , how does it affect the alarm which is being repeated at the specified interval Here is the code of setting alarm, I am calling this method in the onCreate() public void setAlarm() { …
0
votes
1 answer

android - set both class and action for intent

I have an Intent that I initiate like this: notificationIntent = new Intent(context, HomeActivity.class); This intent is attached to an ongoing notification. Now, in addition to the class opened when clicking the intent, I want to add an action…
0
votes
2 answers

android running service starts app autmatically

in my app i start a service to receive notifications while the app is in background - this service forces my app to start automatically after i stop it. i tried to solve the problem by using pending intent but it still happens. Here is my intent to…
0
votes
0 answers

How to use JSONCreator to serialize

I came across this class on Github that serializes a pendingintent: https://github.com/8tory/json2notification/blob/master/json2notification/src/main/java/com/bluelinelabs/logansquare/typeconverters/PendingIntentConverter.java Can anyone tell me…
0
votes
1 answer

NFC intent launch app with launcher activity only if the app isn't running in background

I'm trying to open my application from NFC app chooser dialog which appears when NFC tag is detected by the system. My app appears in chooser dialog. Case 1: When application is running in background. On NFC tag detection bring background…
Vijay Vankhede
  • 3,018
  • 1
  • 26
  • 46
0
votes
0 answers

How to update textview with value from subsequent Notification?

I'm working on Sony Watch now to implement simple notification whenever user clicks a button from my application(I'm doing this using pub nub). So I'm currently facing an issue of not being able to update the textView with the value from a…
0
votes
3 answers

Pending Intent Causing mainactivity to reload, why is that?

I'm trying to write a service that will check every midnight for new data from the server and will download it. But when i start the app the mainActivity screen reloads after few seconds. I'v checed it and it happens because of this service, Why…
Eli
  • 586
  • 2
  • 12
  • 28
0
votes
1 answer

FillInIntent not firing

I am trying to implement a collection widget that starts the main activity of my app when I click on one of its items. For some reason, the views on the list are clickable (I see the ripple effect when I do it) but no intent is being launched. Can…
1 2 3
99
100