https://kotlinlang.org logo
#compose-android
Title
# compose-android
c

chiq

07/06/2023, 3:33 AM
Newbie question here: Is there a way to setup integration testing in android with appcompatactivity(im using fragment) and composeview layout? I tried using createAndroidComposeRule but it requires me to migrate to ComponentActivity. I'm wondering if its possible to make it work with appcompatactivity?
i

Ian Lake

07/06/2023, 4:10 AM
AppCompatActivity extends FragmentActivity which extends ComponentActivity. That means you can certainly use any AppCompatActivity with createAndroidComposeRule
c

chiq

07/06/2023, 1:25 PM
That's what I thought too, but it keeps giving me error that that the activity im supplying to `
Copy code
createAndroidComposeRule<MyActivity>
is not within its bound, but if I changed MyActivity to extend ComponentActivity it works. Ohhhh, i think its only the lint that is complaining but the code works.
7 Views