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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:02:23+00:00 2026-06-11T19:02:23+00:00

I am trying to create a button that, when pressed, automatically creates an alarm

  • 0

I am trying to create a button that, when pressed, automatically creates an alarm in a mobile device set to a certain time specified earlier in the activity.

Namely, users select a time they want to wake up at using a TimePickerDialog and the “Create Alarm” button takes the calendar object the user “created” and sets an alarm for that time.

A lot of examples on the internet show how to do this in a separate activity, but I was hoping to find a way to do it without creating a new activity.

Is there a way to do this, or am I stuck having to create a new activity?

Thanks all.

  • 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-11T19:02:25+00:00Added an answer on June 11, 2026 at 7:02 pm

    You can definitely set the alarm inside the same activity. But I’m guessing this is not what you’re asking. If you want your alarm to trigger some code to run, even when your app is not in the foreground, then this code needs to be inside a receiver, not an activity. Activities only run when they are in the foreground. When you mention examples that use a “separate activity”, do you actually mean a receiver?

    So, to answer the question that I think you were asking, the code to set the alarm will be in an activity class, while the code that runs when the alarm goes off will be in a receiver class.

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

Sidebar

Related Questions

I'm trying to create an image button that, when pressed, presents the users a
I'm trying to create a button that fades out and then in when I
I am trying to create a button that already has an index captures and
I am trying to create a button that can pop up the speech input
I am trying to create a flip button that shows changing content on every
I'm trying to create a post button that inserts the latest posts into a
I'm trying to create a simple button that deletes a row from the database.
I'm trying to create the effect of a button that 'lifts' from the page
I am trying to create a delete button over each image that appears in
I am trying to create buttons that play single sound files and one button

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.