btn.setOnClickListener {
try {
val rpc = XMLRPCClient(“rpc.rsscloud.org:5337/RPC2”, “”, “”)
val res = rpc.call(“ping”, “http://rivers.silverkeytech.com/blogs/android-rivers/rss.xml” )
Log.d(TAG, “Return content $res”)
}
catch(e : Exception){
Log.d(TAG, “Call RPC error ${e.getMessage()}”)
}
}
If I remove try-catch statement everything just works.
This is the error
Kotlin: Type mismatch: inferred type is jet.Int but Unit was expected
This is the declaration of the extension method
``
public fun View.setOnClickListener(action: (View?) -> Unit): Unit {
setOnClickListener(OnClickListener(action))
}