I learn some code in Kotlin and want to translate it into Java. In Kotlin, when creating CustomView, I see that they directly pass ArrayList parameter to class and extends ArrayAdapter like below:
class PostClass (private val userEmail: ArrayList<String>,
private val userImage: ArrayList<String>,
private val userComment: ArrayList<String>,
private val context: Activity) : ArrayAdapter<String>(context, R.layout.custom_view, userEmail)
{ //Do something }
I also try to convert to Java:
class PostClass(ArrayList<String> userEmail,
ArrayList<String> userImage,
ArrayList<String> userComment, Activity context)
extends ArrayAdapter<String> (context, R.layout.custom_view, userEmail)
{ //Do something }
However, it shows a lot errors. So, can anyone help me to convert it correctly? Thank you.