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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:57:05+00:00 2026-06-04T12:57:05+00:00

In my android i app i can alarm functionality and as well logout functionality.

  • 0

In my android i app i can alarm functionality and as well logout functionality. After setting my alarm time i am exiting the app by clicking the logout button.

I am using

         ExitActivity.this.finish();  
         Intent intent1 = new Intent(ExitActivity.this,PinActivity.class);  
         intent1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
         startActivity(intent1);  

         Intent intent = new Intent(Intent.ACTION_MAIN); 
         intent.addCategory(Intent.CATEGORY_HOME);  
         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
         startActivity(intent); 

this code to exit the app,which goes to home pin screen and after that it launches the home screen. This is because when i am coming back to my app it launches the pinscreen. Alarm working exactly what i want but while alarm popup message it has the pinactivity in the background(which i don’t want). I wan’t to get rid out of the pin activity in the background.

This is my receiver class?

     public class ShortTimeEntryReceiver extends BroadcastReceiver{

     @Override
     public void onReceive(Context context, Intent intent) {

    Toast.makeText(context,"Alarm Working", Toast.LENGTH_SHORT).show();

     try {
         Bundle bundle = intent.getExtras();
         String message = bundle.getString("alarm_message");

         Intent newIntent = new Intent(context, ReminderPopupMessage.class);
         newIntent.putExtra("alarm_message", message);
         newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(newIntent);
        } catch (Exception e) {
         Toast.makeText(context, "There was an error somewhere, but we still received an alarm", Toast.LENGTH_SHORT).show();
         e.printStackTrace();

        }
}

How do i do that?
Thanks for your help guys..

  • 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-04T12:57:07+00:00Added an answer on June 4, 2026 at 12:57 pm

    You should use Alarm Manager to set alarms in Android. The alarm manager holds your alarm and fire an pending intent on alarm time.

    First create a pending intent like this :

     pendingIntent = PendingIntent.getService(CONTEXT, ALARM_ID,  INTENT_TO_LAUNCH, 0);
    

    Then use this pending intent to set an Alarm like this :

     AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
     alarmManager.set(AlarmManager.RTC_WAKEUP, ALARM_TIME, pendingIntent);
    

    This will start the pending intent at given time.

    To remove an alarm you have to recreate the same Pending Intent with same ALARM_ID :

     alarmManager.cancel(pendingIntent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an Android app where users can upload video to Youtube. I'd like
I've just started debugging my first three line long android app and I can't
How can I build an android app which basically get the inputs from user
Can we rely on our Android app getting a set amount of memory or
im wondering if we can develop our android app in any computer we use
I am working on an android app i want to know how i can
I have an Android app created with Adobe AIR and Flex. How can I
while i'm developing my android app on my HTC sensation, i can't run the
I want to install my Android app on a BlackBerry device. Can someone please
I'm creating an Android app where in the user can set the daily reminder,

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.