1

I am building a Jetpack Compose application and need to extend an Activity (e.g., BrightcovePlayer) to handle specific logic and states. My goal is to integrate this custom Activity into a Jetpack Compose screen using AndroidView.

For example, I want to create a class that extends an Activity, manage its states and lifecycle from there, and then embed its functionality into my Compose-based UI. How can I properly achieve this with AndroidView?

Here's an outline of what I am trying to do:

  • Extend a custom Activity. Use it with AndroidView in a Compose screen. Ensure lifecycle and state management works correctly within the Compose framework.

Any guidance, examples, or best practices would be greatly appreciated!

2
  • If you want to use multiple Activities in your app you can just add your Activity containing BrightcovePlayer to the navigation graph
    – xephosbot
    Commented Dec 11 at 16:53
  • My entire application is based on a single activity. Isn't there a way to achieve this using only Compose?
    – Zurriaga
    Commented Dec 11 at 18:26

0