-1

I am trying to create a simple android project which has a organisation (Of Activity XML)

|Image | Button | Button |

|Listview Row(Image + Text + Image) |

| Button |

The samples which I have seen extend ListActivity and override getView method. The problem I see with that is that the activity would only have a list and not the other things which I have shown in organisation.

It would be something like extending the ListView... But I am not able to find a solution.

Can you guys please help..

thanks a ton.

BMBI
  • 21
  • 1

1 Answers1

0

just follow these steps

  1. Get the listview from your xml using findViewById
  2. Now set adapter in it using listview.setAdapter(new CustomAdapter());
  3. Create an adapter extending BaseAdapter and override as you already know getView method
  4. In your getView method inflate your xml (the one you need to showas arow)

  5. Inflation getSystemService(Context.Layout_Inflator_Service);

Use now the inflate method...this returns you that xml reference as a View object use this object now and use findviewbyid on that view to set properties of those imageview and textview inside your row xml file.

cafebabe1991
  • 4,928
  • 2
  • 34
  • 42