Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7039703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:49:50+00:00 2026-05-28T01:49:50+00:00

I am setting up AlarmManager with a PendingIntent in activity A. Then I would

  • 0

I am setting up AlarmManager with a PendingIntent in activity A.
Then I would like to be able to call cancel() on the same PendingIntent from a different activity B.

The Android documentation says the following:

“If the creating application later re-retrieves the same kind of PendingIntent (same operation, same Intent action, data, categories, and components, and same flags), it will receive a PendingIntent representing the same token if that is still valid, and can thus call cancel() to remove it.”

Is it possible to store a PendingIntent in a database
and retrieve it from a different activity?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:49:50+00:00Added an answer on May 28, 2026 at 1:49 am

    If you are not creating your PendingIntent in a dynamic way, then you just need to create it the same way.

    I would recommend creating a singleton that will create and deliver your PendingIntent. That way, you could call something like this from anywhere in your application:

    PendingIntent pi = PendingIntentHelper.getInstance().buildPendingIntent();
    am.cancel(pi);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm currently setting the alarm via the following.. //set the alarm alarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingintent);
I'm setting an alarm like this: alarmManager.set(AlarmManager.RTC_WAKEUP, alarmTime, pendingEvent); I'm interested in removing all
When setting a service to go off at particular time, I use the AlarmManager
Android's AlarmManager Javadoc states When an alarm goes off, the Intent that had been
So i'm setting a repeating alarm to fetch data from a server. The problem
I've got a question about setting alarms in the AlarmManager. I found something in
Setting #myDiv { width:100%; height:100%; position:absolute; top:0; left:0; } makes the div the same
I am setting some events through AlarmManager. below is the code. AlarmManager AM =(AlarmManager)getSystemService(Context.ALARM_SERVICE);
In my app, i am setting the Notification as like below code: // for
The setting is easy; I want to be able to add a class to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.