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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:20:53+00:00 2026-05-26T01:20:53+00:00

I want to start multiple instance of the same Activity class from a Service

  • 0

I want to start multiple instance of the same Activity class from a Service. The reason I’m doing this, is because I have a Service that runs a “scan” daily, and if it finds any malfunctions it should display a popup for each malfunction.

The Activity that I’m starting is more like a Dialog, has a Dialog theme to display info about the malfunction.

Manfiest:

<activity
   android:name=".ui.dialogs.MalfunctionActivity"
   android:theme="@style/MyDialog"
   android:launchMode="standard">

Intent to start the activity from Service:

    Intent displayMalf=new Intent(this, MalfunctionActivity.class);
    displayMalf.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(displayMalf);

PROBLEM: to start the Activity from a Service I need the FLAG_ACTIVITY_NEW_TASK which somehow cancels the launchMode="standard" from the manifest, and gives me just one Activity even if I try to start multiple diffrent instances.
Is there anyway in which I can achieve this?

  • 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-26T01:20:54+00:00Added an answer on May 26, 2026 at 1:20 am

    It was so simple. There is the flag FLAG_ACTIVITY_MULTIPLE_TASK which according to the documentation :

    Used in conjunction with FLAG_ACTIVITY_NEW_TASK to disable the behavior of bringing an existing task to the foreground. When set, a new task is always started to host the Activity for the Intent, regardless of whether there is already an existing task running the same thing.

    Was exactly what I need. Thanks and sorry for answering on my question. It is not a habit. 🙂

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

Sidebar

Related Questions

I want to deploy the same applications multiple times on the same tomcat instance
I want to make multiple instances of this class. public class Worker { private
I have a timer in my class that is I only ever want one
I want to start using Python for small projects but the fact that a
I want to start using .NET 3.5 features in an app that is currently
Is this possible in an Android app? I want to make it so that
I have a service application built in Delphi that works great. It does exactly
I am working on a .NET Web Service and I want to run multiple
I have a class that is wrapped with swig, and registered with lua. I
I have a CCLayer class where I create an animated sprite that is 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.