Valeu Fred! Tua dica vai ser útil pra mim também! :)
Em 28 de maio de 2013 16:02, Fred <fredferrao@gmail.com> escreveu:
opa, nem deu tempo, ia sugerir generic tambem, tu pode definir na classe tambem, algo como:public class MinhaClasse<T> {private List<T> meuList...public MinhaClasse(List<T> lista){
this.meuList = lista;...Ai quando for instanciar a classe ja passa qual o tipoMinhaclasse<String | Object | WhatElse> classe - new ...Em 28 de maio de 2013 14:53, Felipe Aron <felipearon@gmail.com> escreveu:Grande Diogo! :) Certinho!--2013/5/28 Diogo Henrique <diogjp10@gmail.com>
vê assim Felipe List<?>...--
2013/5/28 Felipe Aron <felipearon@gmail.com>--Galera,Numa classe "base" meu construtor irá receber uma lista (List<>) qualquer. Sendo assim usei como parâmetro List<Object>:public _BaseAdapter(Context ctx, List<Object> lista)
As classes que irão herdar fará o controle do tipo correto em questão.Quero então passar uma lista - List<Pedido> para esse parâmetro, porém ao fazer isso ocorre erro dizendo que é preciso enviar um tipo List<Object>.Como faço pra passar uma lista "genérica" como parâmetro?--Analista-Programador
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--Analista-Programador
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
"Frederico Ferrão da Silva"--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Analista-Programador
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário