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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:43:52+00:00 2026-06-18T00:43:52+00:00

So I have an Alarm application which sets alarms. I have a very simple

  • 0

So I have an Alarm application which sets alarms. I have a very simple Service AlarmReceiver to get the alarm and do some action :

public class AlarmReceiver extends Service{

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();
        MediaPlayer MPRadio1 = MediaPlayer.create(this, R.raw.radio3);
        MPRadio1.start();
        Toast.makeText(getBaseContext(), "Alarm received", Toast.LENGTH_LONG).show();           
    }

Now I’m wondering how would I be able to change the notification sound from another Activity so the AlarmReceiver service knows which sound should be played when alarm is received? So user can choose lets say, 3 sounds with radiobuttons and which he chooses AlarmReceiver knows which to play?

  • 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-18T00:43:53+00:00Added an answer on June 18, 2026 at 12:43 am

    Store the user’s preferences (the uris to the ringtones in your shared preferences) then when creating it use the value stored in the preferences to get the new value. You should always grab this value from the shared preferences when registering your alarm.

    Note:

    Also you should use SoundPool instead of a MediaPlayer AND you should also use Notifications they way they were intended, to be sent to the Notification bar via a PendingIntent. This notification sounds like your your actual activity is doing it, which is not how Notification tones should work.

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

Sidebar

Related Questions

I have an AlarmReceiver class which executes when alarm rings at a particular time
I have an application, which sets an alarm using AlarmManager, which starts another Activity
I have an Alarm Application which stores its alarms into a database so it
I have a Homework Planner application which I want to create an Alarm for
I have an application ( Amnesia ) which lets you create memos/stickers/alarms/Phone Book, and
I am having a reminder application in which i have an alarm manager like
I have an application in which i have made a alarm clock. In my
I am implementing an application in which I have to display alarm info (day,
I have application, which makes event in alarm manager, and at specific time its
I have created one alarm clock application. In which, when user clicks on the

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.