ListView android:autoLink="phone."



  • Mine. ListView orders are displayed, mobile numbers are illuminated, but with them, dates and prices are also lit. That's what it looks like:

    введите сюда описание изображения

    Question: Is it possible to indicate in some filters that the telephone number can only be after the word? Тел.or something else. And if not, how can one Item for ListView insert two or three TextVievso I can share the main infu about the order and the phone number, so that I can avoid lighting unnecessary lines?



  • If you have a listView consisting of one text field, a call must be made when the cell is clicked. You can go two ways: (1) Cossal method. This is provided that all elements are identical to others.

    String text = yourTextViewArray.get(i).getText().toString();//достаем из onItemClickLister-a
    text.getText()..substring(text.indexOf("Тел. ") + 5, text.indexOf("Дата"))
    

    Something like that. We need to play.

    (2) That's the right way. We need to create an object like this:

    public class Client {
    
    private String order;
    private String name;
    private String phone;
    private String date;
    
    public String getOrder() {
        return order;
    }
    
    public void setOrder(String order) {
        this.order = order;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public String getDate() {
        return date;
    }
    
    public void setDate(String date) {
        this.date = date;
    }
    

    }

    Use your adapter. ArrayList<Client>♪ How to create a caste adapter, googly. Through the xml, you'll be literate about what you need to look like. And on the click. listview Here you go. clients.getPosition(position).getPhone();


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2