Is it possible to define static shortcuts for multiple flavors without duplicating the shortcuts.xml ? I have two flavors:
- main (package: com.test)
- free (package: com.test.free)
The shortcuts.xml looks like this:
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:enabled="true"
android:icon="@drawable/ic_shortcut_add_photo"
android:shortcutId="new_photo"
android:shortcutLongLabel="@string/new_photo"
android:shortcutShortLabel="@string/new_photo">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="com.test.MainActivity"
android:targetPackage="com.test"/>
</shortcut>
The problem is that the package name in the intent can not refer to a string resource and must be hardcoded in the xml.
To also provide the shortcuts for the free flavor i have to copy the shortcuts.xml and change the targetPackage to com.test.free which is a bad solution.