Note that there are some explanatory texts on larger screens.

plurals
  1. POActivity/Application Launched From NFC Never Appears in Recent Apps List
    primarykey
    data
    text
    <p>I am developing an application targeted at ICS+ phones. </p> <p>In the application, I have a Splash screen, and a couple other screens that can be launched from the Splash screen or via NFC touch. One of my activities contains the following intent filter: </p> <pre><code> &lt;intent-filter&gt; &lt;action android:name="android.nfc.action.NDEF_DISCOVERED" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="application/com.myapp.thing.android.beam.ip" /&gt; &lt;/intent-filter&gt; </code></pre> <p>For some reason I can't figure out, any time the activity containing the above intent filter is launched, the activity does not appear in the "Recent Apps" list when the user pushes the "Home" button. Via the debugger I have verified that it is not being destroyed, just stopped. </p> <p>If the Splash screen was open prior to the ThingActivity, the Splash will show in the Recent Apps list, even if it was not the top activity when the Home button is pushed. Clicking the Splash in the Recent Apps list will show the Splash, not the activity that was previously on top. Any activity on top of the Splash screen seems to be 'lost' despite still running threads and receivers in the bg. </p> <p>The weirder behavior is that this behavior also applies to any activity launched from the activity containing the NFC intent filter, or any activity launched from those activities, etc. </p> <p>If I remove the intent filter, this behavior disappears and whatever activity was on top will ALWAYS show in the Recent Apps list but becomes broken, because NFC is a core feature.</p> <p>My full Manifest is as follows:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp.thing" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" /&gt; &lt;!-- Permission required to use the TCP transport --&gt; &lt;uses-permission android:name="android.permission.INTERNET" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" &gt; &lt;/uses-permission&gt; &lt;!-- Permission required to use the Bluetooth transport --&gt; &lt;uses-permission android:name="android.permission.BLUETOOTH" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.BROADCAST_STICKY" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.NFC" /&gt; &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" &gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt; &lt;!-- RECORD_AUDIO is needed to create an audio recorder --&gt; &lt;uses-permission android:name="android.permission.RECORD_AUDIO" &gt; &lt;/uses-permission&gt; &lt;!-- MODIFY_AUDIO_SETTINGS is needed to use audio effects such as environmental reverb --&gt; &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" &gt; &lt;/uses-permission&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".ui.SplashActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.myapp.thing.ui.ReceiverActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="portrait" &gt; &lt;/activity&gt; &lt;activity android:name="com.myapp.thing.ui.BaseActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="portrait" &gt; &lt;/activity&gt; &lt;activity android:name="com.myapp.thing.ui.BroadcasterActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="portrait" &gt; &lt;/activity&gt; &lt;activity android:name="com.myapp.thing.ui.ChooseFileActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="portrait" &gt; &lt;/activity&gt; &lt;activity android:name="com.myapp.thing.ui.ThingActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="portrait" &gt; &lt;intent-filter&gt; &lt;action android:name="android.nfc.action.NDEF_DISCOVERED" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="application/com.myapp.thing.android.beam.ip" /&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.SEND_MULTIPLE" /&gt; &lt;action android:name="android.intent.action.SEND" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="audio/*" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;service android:name="com.myapp.thing.service.ThingService" android:label="ThingService" &gt; &lt;/service&gt; &lt;/application&gt; </code></pre> <p></p> <p>Why does including this intent filter prevent my Application from being in the recent apps list?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload