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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:17:38+00:00 2026-06-10T20:17:38+00:00

When I start an activty after receiving a GCM Message, it starts, next to

  • 0

When I start an activty after receiving a GCM Message, it starts, next to the desired Activity, the MainActivity also. The problem is, I want to display the disired Activty (DialogActivity) as a Dialog-Box-Style Activity, so its background is transparent.

This is how I start the Activity:

@Override
protected void onMessage(Context arg0, Intent arg1) {
  Log.d("GCM", "RECIEVED A MESSAGE");
  generateNotification(arg0, arg1.getStringExtra("message"));
  Intent i = new Intent();
    i.setClass(this, DialogActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(i); 
   }

This is the theme in the styles.xml

<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>

So the transparent Activity is laying on top of the MainActivity, which I want to avoid. It should show only the DialogActivity. Anyone knows 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-06-10T20:17:39+00:00Added an answer on June 10, 2026 at 8:17 pm

    I already solved it. For anyone in future facing the problem:
    Add FLAG_ACTIVITY_MULTIPLE_TASK Flag to the Intent

    Intent i = new Intent();
    i.setClass(this, DialogActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
    startActivity(i); 
    

    According to the Android Documentation

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

Sidebar

Related Questions

Basically I want to have a button to start a new activity after login.
I have an activity that starts after a certain time. Once this activity starts,
I'm not able to start activity from thread. I want to start one activity
I want to start an activity when the user presses the space bar. My
I want to start an activity when the service is ran for the first
I have this situation where i have to start an activity from my mainActivity.
How to start an activity after the animation has ended. I have added android:oneshot=true
Support App starts activity A, then A starts activity B and finishes itself. After
After I start the activity I am unable to scroll down to see other
I need to start the activity AlarmReceiver after 10 seconds (for example). I need

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.