Skip to content Skip to sidebar Skip to footer

Is Selectively Enabling An Activity-alias In The Manifest With Android:enabled="@bool/tablet" Or "@bool/phone" Supported?

To avoid some Tablet/Phone wiring, I want my app to issue itself an intent via an activity-alias, and make the manifest system deliver it to the main activity (for tablet) or a new

Solution 1:

No, it's not supported because things like screen width (res/layout-w600dp) can change by orientation but Google didn't apparently notice that 'smallest width' (res/layout-sw600dp) isn't affected by that. See Fragment Orientation Change - Better Test than for Landscape

Note too that the workaround suggested in How to specify Activities that are only for phones or tablets on Android doesn't work for competing <activity-alias> because you cannot construct a ComponentName to uniquely select between aliases of the name name.

(Unless it's possible to disable only one of the targeted activities and rely on ordering within the manifest to swap between the alternatives, but that has fragility issues.)

Post a Comment for "Is Selectively Enabling An Activity-alias In The Manifest With Android:enabled="@bool/tablet" Or "@bool/phone" Supported?"