I am unable to recover the id of a listview

Asked

Viewed 30 times

0

Good evening, I created an xml with a Textview to insert in my Listview, because I want to make it custom.... But I’m not getting it back in my way that it is within the class Ragment? someone could help me?

Dual.java (class Fragment)

public void vectorOne(){
List<String> list = new ArrayList<>();

        final ArrayAdapter<String> listing = new ArrayAdapter<String>(getActivity(),
                android.R.layout.lita_personalizada_dupla_sena, //nao estou conseguindo
                android.R.id.txt_final, //nao estou conseguindo
                list
        );

        listArray.setAdapter(listing);

       //restante do code
}

Thank you....

  • It’s not like that. You have to create a class that extends the Basedapter and this class recover the custom layout. The Adapter will be an instance of the class you create. It gives a search on Google. There are thousands of tutorials on this: Listview custom layout

  • Ahh got it, okay

  • View view = Act.getLayoutInflater(). inflate(R.layout.personalizada_dupla_sena, Parent, false); Textview text = (Textview) view.findViewById(R.id.txt_final);

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.