bromaanoviasalemal

Download Raw Clone


  1. class MainActivity : AppCompatActivity() {
  2. class UsuarioViewHolder(itemView: View): RecyclerView.ViewHolder(itemView){
  3. val nombre: TextView = itemView.findViewById(R.id.nombre)
  4. }
  5. override fun onCreate(savedInstanceState: Bundle?) {
  6. super.onCreate(savedInstanceState)
  7. setContentView(R.layout.activity_main)
  8. val lista: RecyclerView= findViewById(R.id.list)
  9. lista.layoutManager = LinearLayoutManager(this)
  10. var usuarios= listOf(
  11. users("Pepe", 25),
  12. users("Jose", 20),
  13. users("Luis", 15)
  14. )
  15. lista.adapter = PersonAdapter(usuarios, this)

Raw paste data: