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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:05:31+00:00 2026-05-27T13:05:31+00:00

I observed from WhatsApp such behaviors: when a new message arrives, WhatsApp will launch

  • 0

I observed from WhatsApp such behaviors: when a new message arrives, WhatsApp will launch a dialog-style activity and such a activity could be cancelled or confirmed by the user.

Therefore, I added a similar dialog-style activity to my app. For test purposes, I also added an alarm manager and an alarm receiver so that this activity will be launched every 10 seconds by the alarm receiver.

The code I used to launch the dialog-style activity is:

   Intent dialogIntent = new Intent(MyApplication.sharedApplication, MyDialogStyleActivity.class);
   dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   MyApplication.sharedApplication.startActivity(dialogIntent);

Everything looked fine if my application had not been launched. The dialog activity would show , behind which was the home screen, just like WhatsApp’s behavior.

But there was a problem, if my application had been launched and put in the background, and then the alarm triggered the launch of the dialog activity, before the launch of the dialog activity, the main activity of my app would come back to foreground and show as well.

I’m confused, all I want for now is that, even if my application had been launched, when something triggers the dialog-style activity, only this dialog-style activity would show, no main activity or any other un-related activity.

Anyone could help?

  • 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-27T13:05:32+00:00Added an answer on May 27, 2026 at 1:05 pm

    Your application maintains an activity stack. So your main activity A and your dialog activity B is represented as A->B in your app’s activity stack.

    When your app is launched and put to background. When your dialog activity is invoked and brought to the foreground, your main activity A is still live and thus will be shown as well. Maybe you can call “finish()” in A after startActivity(dialogActivity) to make sure A is finished and goes away.

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

Sidebar

Related Questions

I'm using the new print from Python 3.x and I observed that the following
I have observed from the HDPI, MDPI and LDPI icons from a new Android
I've observed a difference in behavior between the new library in Visual Studio 11
I observed something last week that I did not expect, and will describe below.
I had to pass a dataobject from one activity to another. The best way
I have two questions, stemming from observed behavior of C# static methods (which I
I know from what I have observed, and from what people are saying on
As I observed that UIActionSheet is always appearing from down side in iPhone, but
I just observed that my query: SELECT X.A, X.B, X.GroupName FROM TableA X INNER
I have a UITableView which downloads its tableviewcells images from a server. I observed

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.