我正在尝试@SharefPref
在 kotlin 中使用 AndroidAnnotations,但出现以下错误
org.androidannotations.annotations.sharedpreferences.Pref can only be used on an element that extends org.androidannotations.api.sharedpreferences.SharedPreferencesHelper
我究竟做错了什么?
//Interface
@SharedPref(SharedPref.Scope.APPLICATION_DEFAULT)
open interface MyPreferences {
@DefaultInt(-1)
fun someIntValue():Int
}
//Fragment
@Pref
lateinit open var sharedPref:CongressPreferences_
//usage within fragment
val get: Int = sharedPref.selectedEventId().get()