I have two layouts one is main and other is listview used when user clicks some button. Which is better in perfomance, to use two separate activity for both layouts or have to implement both in same activity.
2.And my main activity extends Activity but to display listview i need to extend ListActivity so if i extend ListActivity app is forceclosing , may be cause I’m tryin to load linear layout first. So what’s solution ?
I have two layouts one is main and other is listview used when user
Share
There is no definite answer regarding performance. Having a simple activity perform two actions may impose some runtime overhead, while having two different activities will imply an increase in code size. If I were you I wouldn’t bother about performance, and I would choose whatever solution is better design-wise (probably creating two activities, but you never can tell).
Note that extending
ListActivityis not needed in order to display aListViewin an activity, its just a convenience. If it weren’t, then people would have lots of trouble trying to come with activities displaying more than a singleListView.