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 8937519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:25:49+00:00 2026-06-15T10:25:49+00:00

I want to have a reminding function(by set reminding time) in my app ,using

  • 0

I want to have a reminding function(by set reminding time) in my app ,using notification. And I get to know that there may used service, broadcast and alarmmanger,

How can I complete this function ?

I think there are two ways:

  1. use the service ,and the notification is in service
  2. use the service to send broadcast,and the notification is in broadcastReceiver

the first question:

  1. which way is right or better?
  2. how to use that alarmmanager ? is that like the Timer class in java?
  • 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-06-15T10:25:50+00:00Added an answer on June 15, 2026 at 10:25 am

    Simplest and most efficient way would be to use AlarmManager for something like reminders. You will need to make a BroadCastReceiver that receives your alarm. Your receiver can make the notification, since the onReceive() method of the receiver also takes in a Context parameter. To make the Alarm, you will have to get an instance of the AlarmManager Class, make a PendingIntent with what you need, then actually set the Alarm.

    Sample Code for setting an Alarm

    Intent intent = new Intent (this, AlarmBroadcastReceiver.class);
    PendingIntent pendIntent = PendingIntent.getBroadcast(this, id,  intent, //makes a new intent
    PendingIntent.FLAG_UPDATE_CURRENT); //only updates PendingIntent, does not recreate
    AlarmManager alarmManager = (AlarmManager) getSystemService (Context.ALARM_SERVICE);
    alarmManager.cancel(pendIntent); //used to cancel if previously active
    alarmManager.set(AlarmManager.RTC_WAKEUP, timeToExec, //sets the alarm to exectute once
                 pendIntent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript function that gathers two arrays, imagepaths and captions. I want
Let's imagine I have an unknown function that I want to approximate via Genetic
I have a function that I want to call from within a class method.
I have a function that is called heavily in my app. It is basically
i want have an image and i want to set it as a background
I want to have an insert tab button for my UITextView so that users
Refining my question little bit this time. :D I have this function, but instead
i want to make equal height function in javascript , i used getElementsByName method
I have a simple Python script that I want to stop executing if a
I have a MATLAB function that finds charateristic points in a sample. Unfortunatley it

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.