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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:34:44+00:00 2026-05-26T14:34:44+00:00

I have to develop an application that gives a popup message at a certain

  • 0

I have to develop an application that gives a popup message at a certain time which is set by the user.

I will use the android AlarmManager, which starts a service, and that service will start the activity containing the popup interface with an OK button.

I want to pass data to that activity, how can this be done (otherwise i will have to query the database)?

  • How to pass data from the activity to the service while setting the starting time using AlarmManager?
  • How to later pass that data to the activity that is started by the service?

Also if a service starts an activity in my application (not the main activity), and database handler functions are in a separate class, is the database accessible?

  • 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-26T14:34:45+00:00Added an answer on May 26, 2026 at 2:34 pm

    When you pass a PendingIntent object to the AlarmManager.set method, you can put any extras you want in the Intent object wrapped in the pending intent. For example:

    Intent intent = new Intent(getApplicationContext(), YourService.class);
    intent.putExtra("someKey", someData);
    intent.putExtra("anotherKey", anotherData);
    PendingIntent pi = PendingIntent.getService(getApplicationContext(), REQUEST_CODE, intent, FLAGS);
    alarmManager.set....
    

    And then, as the service starts you receive the same intent object:

    public void onStartCommand(Intent data, int startId, int flags) {
        int data1 = data.getExtra("someKey");
    }
    

    And you can do the same when starting the activity from your service:

    Intent activityIntent = new Intent(getApplicationContext(), YourActivity.class);
    intent.putExtra("key", data1);
    

    In fact, if you don’t do anything special in your service but launching the activity, why won’t you just set an intent for the activity in your alarm?

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

Sidebar

Related Questions

I have to develop a Java ME (formerly known as J2ME) application that will
I am using asp.net MVC to develop an application that will have ajax interactions.
We have a .net application that we didn't develop, but use. I can tell
I have to develop an application with which my client will do visual design.
I have to develop an application, which will request to a web service developed
I have to develop an application using C#.net that has to be run once
I have been trying to develop a peer to peer application that uses Micosoft's
I have to develop an application which parses a log file and sends specific
Let say that I have two Activity to develop in Android. Upon the end
I develop some application that has database wery generic so really can't use 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.