I have an app using an ScrollView and it loads a lot of images.
I decided to change to ListView. I saw that to use ListView, my class must extend ListActivity.
My current class does a lot of things, like inserting in database, updating, etc.
So, should I create a new classe just for the ListView? Can I just say that my current class now extends ListActivity?
In case I need to create a separate class just for the ListView, how do I use it in my current class?
Any help is appreciated!
Best regards
Your class doesn’t necessary have to extend
ListActivityyou could use a simpleActivitywith aListViewelement in it’s layout. To use your existing activity just replace the currentScrollViewelement with aListViewelement. Then retrieve this element inonCreate()and set its adapter that will map the images to theListViewrows. You will have to make your own custom adapter to show the images.