To avoid any wiring of the tablet / phone, I want my application to self-determine using the activity alias and make the manifest system delivered to the main action (for the tablet) or a new action (for the phone).
If I have this in my manifest:
<activity-alias android:name="my.app.WebContent" android:targetActivity="my.app.activities.Home"/>
then everything is fine and
Intent { act=android.intent.action.VIEW dat=http://www.app.my/url cmp=my.app/.WebContent (has extras) }
Shipped as expected.
If, however, I have this in my manifest:
<activity-alias android:name="my.app.WebContent" android:enabled="@bool/has_one_pane" android:targetActivity="my.app.activities.WebContent"/> <activity-alias android:name="my.app.WebContent" android:enabled="@bool/has_two_panes" android:targetActivity="my.app.activities.Home"/>
with this value /res.xml
<resources> <bool name="has_two_panes">false</bool> <bool name="has_one_pane">true</bool> </resources>
and this is in the values-large / res.xml and values-sw600dp / res.xml:
<resources> <item type="layout" name="content_frame">@layout/activity_item_twopane</item> <bool name="has_two_panes">true</bool> <bool name="has_one_pane">false</bool> </resources>
then my code filters the intent as "invalid" according to PackageManager.resolveActivity ().
It seems that values /res.xml overrides the values-nothing / res.xml, although large values should override the values /res.xml for large displays.
Is this a bug in Android, or did I misunderstand how to do this?
android.weasel
source share