This is my native Android class MainActivity.kt
class MainActivity : FlutterFragmentActivity(), AudioServiceActivity(){}
Error
The AudioServiceActivity was extended already when I started implementing Stripe I also have to implement FlutterFragmentActivity with MainActivity
But it causes errors.
How do I implement both activities with MainActivity?
#Flutter #flutter_stripe
I tried composition and made interface for both
I tried to implement only one Activity at a time and make Object of second Activity to utilize but causing issue still
I resolved this issue by, I made an Interface for one class AudioServiceActivity(), and overridden its functions in the interface. Then implement my interface on Mainactivity.kt And implement the override function in Mainactivity.kt like this,
and this is my interface
interface AudioServiceInterface { fun provideFlutterEngine(context: Context): FlutterEngine? }