Relay share intents through a headless activity
This commit is contained in:
@@ -27,17 +27,6 @@
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<!-- Share target. Without this filter the app never appears in the
|
||||
system share sheet at all; image/* only, the editor takes photos.
|
||||
Goes on the launcher activity: it is singleTask, so a share
|
||||
re-delivered there replaces its intent (onNewIntent -> setIntent)
|
||||
and the running app picks the photo up without a cold start. -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="image/*"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
@@ -45,5 +34,19 @@
|
||||
<data android:scheme="exp+recipescamera"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Share target. Without this filter the app never appears in the
|
||||
system share sheet at all; image/* only, the editor takes photos.
|
||||
A separate no-display relay, not MainActivity: a host app that starts
|
||||
the target without FLAG_ACTIVITY_NEW_TASK would otherwise drop the
|
||||
editor into its own task and the share would look like part of it.
|
||||
ShareActivity relaunches MainActivity in our own task instead. -->
|
||||
<activity android:name=".ShareActivity" android:theme="@android:style/Theme.NoDisplay" android:launchMode="standard" android:excludeFromRecents="true" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:mimeType="image/*"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user