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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:11:51+00:00 2026-05-22T18:11:51+00:00

I just recently started to mess with the alarm manager, and I figured out

  • 0

I just recently started to mess with the alarm manager, and I figured out most of it, but right now its starting to be a bit annoying. So, right now I have it set up with a date and time picker, you type in the date and time and it will pop up a toast message when that times comes, but it seems like it will only take one alarm and any other ones I set get destroyed. Is this something the alarm manager does by itself, or is there something I am missing. Here is my code for my main class, the other is just a broadcast receiver with a toast message in it, so I won’t post it.

public class TextScheduler extends ListActivity {
protected Toast mToast; 
TimePicker time;
DatePicker date;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button button = (Button) findViewById(R.id.button1);
    button.setOnClickListener(setTime);
    time = (TimePicker) this.findViewById(R.id.timePicker1);
    date = (DatePicker) this.findViewById(R.id.datePicker1);
}
private OnClickListener setTime = new OnClickListener() {
    public void onClick(View v) {
        Calendar cal = Calendar.getInstance();
        cal.set(date.getYear(), date.getMonth(), date.getDayOfMonth(), time.getCurrentHour(), time.getCurrentMinute());

        Intent intent = new Intent(TextScheduler.this, AReceiver.class);
        intent.putExtra("caldata", "hooray!!");
        PendingIntent sender = PendingIntent.getBroadcast(TextScheduler.this, 1234567, intent, 0);

        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
        am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);
    }
};
    }

Let me know if you need any more info, thanks in advance!

WWaldo

  • 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-22T18:11:51+00:00Added an answer on May 22, 2026 at 6:11 pm

    AlarmManager compares PendingIntents to see if it already exits. Just change the ID (in your case 1234567), and it will allow you to create additional alarms: one per ID.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been out of school for a few years now, and just recently started
I've been programming for a while, but I just recently started to develop application
I just recently started using this library (the one from CodePlex), but I ran
I have just recently started out programming for Android, and have decided that I
I have just recently started carrying out unit testing for my software written in
I just recently started working with Qt 4.7.4 64-bit in order to make some
I just recently started trying out T4MVC and I like the idea of eliminating
I've just recently started using XNA and now I face a beginners problem, performance.
I have been using TortoiseSVN for a while now and just recently started using
I just recently started diving into Real World Haskell and the book provides some

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.