Using this rule, how do I delete all (Descriptions) of the ListView [closed]

1
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_especialidades);


    Integer[] imgid={
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white,
            R.drawable.ic_plus_white, R.drawable.ic_plus_white, R.drawable.ic_plus_white};


    String[] atividades = new String[]{"Acupuntura", "Alergia e Imunologia", "Anestesiologia",
            "Angiologia", "Angiorradiologia e Cirurgia Endovascular", "Cancerologia",
            "Cardiologia", "Cardiologia Pediátrica", "Cirurgia Cardiovascular", "Cirurgia da Cabeça e Pescoço",
            "Cirurgia do Aparelho Digestivo", "Cirurgia do Trauma", "Cirurgia Geral", "Cirurgia Pediátrica", "Cirurgia Plástica",
            "Cirurgia Torácica", "Cirurgia Vascular", "Cirurgião Dentista", "Clínica Médica", "Coloproctologia", "Dermatologia",
            "Ecocardiografia", "Eletrofisiologia Clínica Invasiva", "Endocrinologia", "Endoscopia", "Endoscopia Digestiva",
            "Ergometria", "Fisioterapeuta", "Gastroenterologia", "Gastroenterologia Pediátrica", "Genética Médica",
            "Geriatria", "Ginecologia e Obstetrícia", "Hematologia e Hemoterapia", "Hematologia e Hemoterapia Pediátrica",
            "Hemodinâmica e Cardiologia Intervencionista", "Hepatologia", "Infectologia", "Instrumentador", "Mastologia",
            "Medicina de Urgência", "Medicina Esportiva", "Medicina fetal", "Medicina Física e Reabilitação", "Medicina Intensiva",
            "Medicina Intensiva Pediátrica", "Medicina Nuclear", "Nefrologia", "Nefrologia Pediátrica", "Neurocirurgia",
            "Neurofisiologia Clínica", "Neurologia", "Neurorradiologia", "Nutrição Parenteral e Enteral", "Nutrologia",
            "Oftalmologia", "Ortopedia e Traumatologia", "Otorrinolaringologia", "Patologia", "Patologia Clínica/Medicina Laboratorial",
            "Pediatria", "Pneumologia", "Pneumologia Pediátrica", "Psiquiatria", "Radiologia e Diagnóstico por Imagem",
            "Radiologia Intervencionista e Angiorradiologia", "Reprodução Humana", "Reumatologia", "Urologia"};





    CustomListAdapter adapter = new CustomListAdapter(this, atividades, imgid);

    ListView lv = (ListView) findViewById(R.id.lv);
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(chamaAtividades(this));
}

public AdapterView.OnItemClickListener chamaAtividades(final Context context){
    return (new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> av, View v, int position, long id) {

            Intent intent;
            switch(position){
                case 0:
                    intent = new Intent(context, ListaActivity.class);
                    startActivity(intent);
                    break;
                case 1:
                    intent = new Intent(context, AlergiaImunologiaActivity.class);
                    startActivity(intent);
                    break;
            }
        }
    });
}

CustomListAdapter:

publicclassCustomListAdapterextendsArrayAdapter{

privatefinalActivitycontext;privatefinalString[]itemname;privatefinalInteger[]imgid;publicCustomListAdapter(Activitycontext,String[]itemname,Integer[]imgid){super(context,R.layout.mylist,itemname);//TODOAuto-generatedconstructorstubthis.context=context;this.itemname=itemname;this.imgid=imgid;}publicViewgetView(intposition,Viewview,ViewGroupparent){LayoutInflaterinflater=context.getLayoutInflater();ViewrowView=inflater.inflate(R.layout.mylist,null,true);TextViewtxtTitle=(TextView)rowView.findViewById(R.id.item);ImageViewimageView=(ImageView)rowView.findViewById(R.id.icon);TextViewextratxt=(TextView)rowView.findViewById(R.id.textView1);txtTitle.setText(itemname[position]);imageView.setImageResource(imgid[position]);extratxt.setText("Description "+itemname[position]);
    return rowView;

};

}

    
asked by anonymous 02.11.2015 / 17:12

0 answers