ActivityView Properties Changer
Demonstrates how to interact with ActivityView properties.
Building and deploying the example
See specific steps relating to building and deploying Qt for Android Automotive examples.
This example shows how to interact with ActivityView properties by changing a property's state at run-time and observing how it impacts the application. On a currently used Android version, this might be useful for checking the behavior of an application embedded inside an ActivityView item.
This example embeds the Activity of a selected package (
com.android.deskclock by default) inside an ActivityView item handled by the Loader which is wrapped inside the Rectangle with frame. The active application can be changed by setting the
className is optional.
First, we import the QML API
Toggling the properties
This example allows toggling the state of the following properties at run-time:
ActivityView visible: switches the state of the visible property of the ActivityView item.
ActivityView parent visible: switches the state of the visible property of the ActivityView's parent Rectangle
ActivityView has parent: changes the assignment of
ActivityView's parent. If "ON", a Rectangle with a frame is assigned as
ActivityViewis stand-alone without a parent.
Note: setting this property to
offcauses destruction of
ActivityView. If set to
onafter being set to
offthe item is created from scratch. This is unlike the show or hide behavior of the other properties.
Loader active: changes the state of the Loader that is handling
These switches enable checking the behavior of ActivityView with different property states, and how they impact the active application (the Activityof the selected package).
Available under certain Qt licenses.
Find out more.