Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SampleAdapter(context: Context, val m_resoruce:Int, val m_list:List<SampleData>)
- : ArrayAdapter<SampleData>(context, m_resoruce, m_list) {
- private val m_inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
- override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
- val v = fun (view: View?): View {
- if (view != null) {
- return view
- }
- return this.m_inflater.inflate(this.m_resoruce, null)
- }(convertView)
- val item = this.m_list[position]
- v.findViewById<TextView>(R.id.title).text = item.title
- v.findViewById<TextView>(R.id.desc).text = item.desc
- return v
- }
- }
Add Comment
Please, Sign In to add comment