我正在开发NFC应用程序。当我的应用程序已经打开,我从NFC标签读取信息,然后打开已注册的Intent-Filter的活动,这将打开一个已经打开的应用程序的新实例。如何关闭以前的实例或打开以前的应用程序实例。如何创建应用程序的单个实例
<activity android:name="com.tanzanite.realike.Fragments.MainActivity" android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:noHistory="false">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter" />
</activity>
请帮助我,对不起,我提前英语不好.. 感谢。
您应该使用活动启动模式http://developer.android.com/guide/topics/manifest/activity-element.html#lmode –
但其工作原理并不清楚以前的活动..i已经使用这个.. –
@Shivamsaxena:如果你已经尝试了评论/回答的建议,但没有在问题中提及它,你是唯一的责难。另外,launchMode正是你应该使用的。 – njzk2