ProxyActivity
Activity that acts as a proxy before launching another target activity.
The proxy activity can be extended by ProxyActivityExtensions. The default set of ProxyActivityExtensions allows:
Configuring the target activity.
Launching the target activity on a configured display, if configured.
The intent data is forwarded to the target activity.
A typical use-case for launching the target activity on a configured display is to avoid launching the target activity inside a virtual display. For this to work, the intent-filter
XML attributes need to be added to the proxy activity and not to the target activity.
The target activity and optionally the display that should be used are configured in the meta-data of the proxy activity in the Android manifest. The target activity is specified by the com.tomtom.ivi.platform.product.activity.META_DATA_KEY_TARGET_ACTIVITY_CLASS_NAME
meta-data key. For example:
<meta-data
android:name="com.tomtom.ivi.platform.product.activity.META_DATA_KEY_TARGET_ACTIVITY_CLASS_NAME"
android:value="com.tomtom.ivi.platform.framework.api.product.defaultactivity.DefaultActivity" />
The display that should be used for launching the target activity can be specified by the com.tomtom.ivi.platform.product.activity.META_DATA_KEY_LAUNCH_ON_DISPLAY_ID
meta-data key. For example:
<meta-data
android:name="com.tomtom.ivi.platform.product.activity.META_DATA_KEY_LAUNCH_ON_DISPLAY_ID"
android:value="1" />
It is also possible to launch the target activity on the default display by specifying the com.tomtom.ivi.platform.product.activity.META_DATA_KEY_LAUNCH_ON_DEFAULT_DISPLAY
meta-data entry to true
. For example:
<meta-data
android:name="com.tomtom.ivi.platform.product.activity.META_DATA_KEY_LAUNCH_ON_DEFAULT_DISPLAY"
android:value="true" />
If neither keys are configured, the target activity is launched on the same display as the proxy activity.
Subclasses can extend the proxy activity with other ProxyActivityExtensions by overriding createExtensions. This is typically used to request Android permissions before launching the target activity or perform certain actions before launching the target activity.