• 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

Update the List View at run time

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am creating a new android application in that app I want add the list content from the Edit text

That means I have a Edit text field,Button,List View I write some thing in edit text and at the time of button clicking I want to add the content in the list view

Please any one help me

Thanks in Advance
 
Ranch Hand
Posts: 56
Android Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let us see what code you have so far, or show some pseudo-code of what you have in mind.
Then we can discuss it here.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, I am just now doing this same thing. Here is what I did:

1) In the layout XML file, I included a ListView with the id "@android:id/list"
2) I create an activity class that extended ListActivity (which automatically handles the ListView declared in the layout file)
3) I created an adapter class that extended ArrayAdapter, and hooked that to the activity (the adapter maintains the list contents)
4) When I got the input from the EditText field, I used Adaptor.add() to add the new entry to the list.
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See API Demos - using List in transcript mode. Similar to what PJ outlined.
 
reply
    Bookmark Topic Watch Topic
  • New Topic