I have the following class:
class CountryDataItem (id: Long?, private val countryName :String?, private var countryFlagUrl : String?,
var gameCount : Int, var liveCount:Int)
: BaseDataItem(id) {
companion object {
fun onCreateViewHolder(
parent: ViewGroup,
onRecyclerItemClickListener: OnRecyclerItemClickListener?
): RecyclerView.ViewHolder {
val view: View =
LayoutInflater.from(parent.context).inflate(R.layout.country_item, parent, false);
}
}
}
But when running:
someKClass.java.getMethod("onCreateViewHolder",parent.javaClass,
onRecyclerItemClickListenerRef.get()?.javaClass)
I'm getting the exception. Can't understand why Maybe the reason related to the fact the the method is "static" but in java getMethod returned also static methods
Aucun commentaire:
Enregistrer un commentaire