0

My code is like this

I want to display Title,resumen,condition in one single row of listview

can u please help me.

Titles=new ArrayList<String>();
Resumens=new ArrayList<String>();
Conditions=new ArrayList<String>();

for(int i=0;i<resp2.getPropertyCount();i++)
{                          
    SoapObject table = (SoapObject)resp2.getProperty(i);
    Titles.add(table.getProperty("Titulo").toString());
    Resumens.add(table.getProperty("Resumen").toString());
    Conditions.add(table.getProperty("Condiciones").toString());
}

2 Answers 2

1

Are you want some like this ?

class Triplet {
    public String title;
    public String resume;
    public String condition;

    public Triplet(String title, String resume, String condition) {
        this.title = title;
        this.resume = resume;
        this.condition = condition;
    }
}

....


ArrayList<Triplet> list=new ArrayList<Triplet>();

for(int i=0;i<resp2.getPropertyCount();i++)
{
    SoapObject table = (SoapObject)resp2.getProperty(i);
    Triplet triplet = new Triplet(table.getProperty("Titulo").toString(),
                                  table.getProperty("Resumen").toString(),
                                  table.getProperty("Condiciones").toString());
    list.add(triplet);
}
Sign up to request clarification or add additional context in comments.

Comments

0

You need to override the getView method in adapter class,by using the getView method you will get the position of the list position,pass that position to your array lists to get the corresponding values.But it all depends your adapter and how you inflate the layout.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.