I'm trying to build an AccountAuthenticator
class with kotlin for android. But when trying to implement the AbstractAccountAuthenticator
class I get the following exception at compile:
No value passed for parameter context
I'm not entirely sure what it means and can't find anything on how to solve it.
Here is the relevant code:
import android.accounts.AbstractAccountAuthenticator
import android.accounts.Account
import android.accounts.AccountAuthenticatorResponse
import android.os.Bundle
class AccountAuthenticator: AbstractAccountAuthenticator() {}
Does anyone know what this means, why, and how to fix it?
AbstractAccountAuthenticator
's constructor takes a Context context
parameter. So you'll have to pass a Context
to it somehow, for example, your AccountAuthenticator
could also have a Context
parameter:
class AccountAuthenticator(context: Context): AbstractAccountAuthenticator(context) {}
I don't know much about Kotlin but AbstractAccountAuthenticator
constructor takes a Context
see here.
So I guess you have to implement this constructor and other related abstract methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With