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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:31:00+00:00 2026-06-07T02:31:00+00:00

I run my application A normally with the launch icon in the Applications menu.

  • 0
  • I run my application “A” normally with the launch icon in the “Applications” menu.
  • I press the home button, so my application “A” is still running on my phone.
  • Now I browse my files presents in my phone, and I use the share action to share this file with my application “A”.
  • The file is sharing perfectly, but instead of using the instance of my application already opened, it opens a new instance of my application “A”.

If I quit this new instance, the first instance is still running and it’s a problem concerning the security goal of my application.

I try to use the FLAG_ACTIVITY_CLEAR_TOP to use the activity in the first instance, but it doesn’t work because it isn’t the same application which is launched by the OS.

Is there a way to do this ? And if yes can you give me some hints or some leads to follow ?


My manifest :

<?xml version="1.0" encoding="utf-8"?>

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar" >
    <activity android:name=".SplashScreenActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".ExplorerActivity"
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
    </activity>
    <activity
        android:name=".ChooseDialogActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.SEND" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="*/*" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND_MULTIPLE" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="*/*" />
        </intent-filter>
    </activity>
</application>

Here is my manifest. Usual process : SplashScreenActivity -> ExplorerActivity

Share process : ChooseDialogActivity -> ExplorerActivity

What I want, it’s that the second ExplorerActivity has to be the same that the first ExplorerActivity if this activity already exists.

  • 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-07T02:31:02+00:00Added an answer on June 7, 2026 at 2:31 am

    Please don’t use launchMode=”singleInstance”. This is not what you want. singleInstance is only for HOME-screens and similar apps.

    Try instead to use Intent.FLAG_ACTIVITY_NEW_TASK when sharing. This will separate your application from the files-browsing application and may get the behaviour you want. You may also need to add FLAG_ACTIVIY_CLEAR_TOP as well, depending on how you’ve programmed your app.

    EDIT

    When you launch ExplorerActivity from ChooserActivity, do this (or something similar):

    Intent intent = new Intent(this, ChooserActivity.class);
    intent.addFlags(Intent.ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
    

    If there is already a task running that contains the ChooserActivity, this should bring that task to the foreground instead of creating a new instace of ChooserActivity.

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

Sidebar

Related Questions

If I run my application when there is allready an emulator running, the applications
Right now whenever I run application It creates a file (file name specified in
I am trying to run a sample bluetooth chat application onto my smartphone (running
I am trying to run an application that normally works when I install on
hello I have made application in Google Api level 7 and is running normally
Sometimes, when I attempt to Run my application on my Droid Charge (running Gingerbread),
I need to run application in every X seconds, so, as far as cron
I developed one swing application but each time you run application new window is
Question: What command do you type in to the Run Application box on ubuntu
I am uploading an image. When I run application from eclipse on my device

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.