- 我通常在“应用程序”菜单中使用启动图标运行我的应用程序“A”。
- 我按下主页按钮,所以我的应用程序“A”仍在我的手机上运行。
- 现在我浏览我手机中的文件,并使用共享操作与我的应用程序“A”共享此文件。
- 该文件完全共享,但不是使用已打开的应用程序实例,而是打开我的应用程序“A”的新实例。
如果我退出这个新实例,第一个实例仍在运行,这是一个有关我的应用程序安全性目标的问题。我该如何访问已在运行的应用程序?
我尝试使用FLAG_ACTIVITY_CLEAR_TOP在第一个实例中使用活动,但它不起作用,因为它不是由OS启动的同一个应用程序。
有没有办法做到这一点?如果是的话,你能给我一些提示或一些线索跟随?
我的清单:
<?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>
这里是我的清单。通常的过程:SplashScreenActivity - > ExplorerActivity
分享过程:ChooseDialogActivity - > ExplorerActivity
我想要什么,那就是第二ExplorerActivity
必须是第一ExplorerActivity
如果这个活动已经存在相同的。
发布您的清单 – 2012-07-05 14:02:29