• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what it the best from ListActivity andActivity

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what it the best from ListActivity andActivity for show listview ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

aruna sameera wrote:what it the best from ListActivity andActivity for show listview ?


I'm not sure what you mean. Can you tell us what you are trying to do?
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both are same...
ListActivity has some methods using which you can easily find your ListView and set Adapters,Listeners on that using getListView() setListAdapter() et cetera methods.

While in Activity you have to write
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But i heard that using ListActivity it is unable to display two item list.two item list mean there is a list.when one of item select from that list it shows another list.
example

here is primary list.

car
bus
train
.....

if i select car ,then it shows another list of cars......
can it implimwnted by using ListActivity
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea that is limitation.
You can not display two list using getListView() method of ListActivity

Reason :

ListView has method getListView which returns reference of list view who is having id list that is the reason we have to have give id @android:id/list in our xml while using ListActivity

So getListView will return only that single list view.

To define new list we must give new id and that new id will be in our name space and we have to use findViewById method in this case.



But we can use one list from android name space and one from our defined name space.


I hope this clears your doubt ...


 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably no, because ListActivity itself will represent one view, but as per your requirements you need two views.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic