• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Activity and ListActivity

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all genius people

I am new to android and referring examples given with SDK.Currently I am working on NotepadExample.I saw that they extends ListActivity.

So my question is what is the difference between extending Activity and ListActivity?I search a lot but no satisfactory answer.
Some says there is no diffrence,some says declaration differs and some says to represent data in a list.Now I am confused which is true.


Please reply..
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ListActivity makes it simple to create an activity whose main purpose is to show a list of elements. You can extend Activity and achieve the same thing but ListActivity makes it easier to achieve...
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:but ListActivity makes it easier to achieve...


Again the same answer.
What I want to know that how it makes simpler, through any internal logic or what?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by studying the javadocs of ListActivity. It has an introductory section that explains how to use it, and lists the methods with which ListActivity extends Activity. Once you know what those do, and think about what you'd need to do in an Activity to achieve the same result, it should become clear how it works. (In a nutshell, it's by managing a ListAdapter and using a ListView to display it.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic