Skip to content

Instantly share code, notes, and snippets.

@hjiee
Last active September 21, 2019 00:40
Show Gist options
  • Save hjiee/a8ef8e9943610981d95d9522d656b078 to your computer and use it in GitHub Desktop.
Save hjiee/a8ef8e9943610981d95d9522d656b078 to your computer and use it in GitHub Desktop.
class ListViewAdapter(
private val layoutResId : Int,
private val items : List<String>
) : BaseAdapter() {
// .. 중략
override fun getView(position: Int, view: View?, parent: ViewGroup?): View? {
var convertView = view
if(convertView == null) {
convertView = LayoutInflater.from(parent?.context).inflate(layoutResId, parent, false)
}
convertView?.tv_item?.text = items[position]
return convertView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment