Hey I need to subclass a Java class, which is a pr...
# announcements
u
Hey I need to subclass a Java class, which is a proxy to native methods, It has 2 constructors, each calling some different native method. When I subclass this class in kotlin, it forces me to have a primary and secondary constructor, with secondary needing to delegating to primary and only that primary delegating to super which is wrong in my case, and that class its a part of library so I cant change it, any ideas?
Copy code
public Call(Account acc, int call_id) {
    this(pjsua2JNI.new_Call__SWIG_0(Account.getCPtr(acc), acc, call_id), true);
    //
  }

  public Call(Account acc) {
    this(pjsua2JNI.new_Call__SWIG_1(Account.getCPtr(acc), acc), true);
   //
  }
although it seems like second one is just a overload of and hiding call_id its not, it calls different swig enum thing Ferko Mrkvicka [10:50 PM] granted I can do
Copy code
class SipCall : Call {

    constructor(
            account: SipAccount,
            sipManager: SipManager,
            callStatusManager: CallStateManager,
    ) : super(account)

    constructor(
            account: SipAccount,
            sipManager: SipManager,
            callStatusManager: CallStateManager,
            callId: Int
    ) : super(account, callId)
however that disallows me to make private val sipManager and callStatusManager