Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

retrieve value from edittext from ListView  RSS feed

 
Ranch Hand
Posts: 31
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose i have my list xml layout like
.............................................
TextView EditText
..........................................
TextView EditText
..........................................
TextView EditText
..........................................
Button
-----------------------------------


so how to print total of EditText when i click on button.
 
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "print total of EditText"?
 
Anand Gajjar
Ranch Hand
Posts: 31
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to print sum of all EditText in dialog box when i click on ok button.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your Edit text contains nos or is it strings that you want to conatenate

you can use getText() and setText() methods of TextView

Let me know if i have interpreted it wrong
 
Anand Gajjar
Ranch Hand
Posts: 31
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my List has number of EditText and each EditText contain 3 digit value. how to retrieve value from all EditText and print Sum of it on dialog.
 
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many EditTexts are there exactly and what exactly is this Xml for are you writing this app for learning Purposes or else...I dont get it why you have to implement a List View for this.You Might rather put this in a ScrollView if the form is too large.Are you trying to build a Calculator??

-Zoheb
 
Anand Gajjar
Ranch Hand
Posts: 31
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nop. this is our customer requirement. according to list size. i have to add number of EditText in my list. and user can enter value in it. and when user click on ok button. we have to print sum of all editText in dialogbox.
 
Vishal Trivedi
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why cant you try getText(); from TextView and add them and show it in Toast ???

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you have implemented list view.You might have implemented your custom adapter in it.
make a global variable. Add text box item in your getView method.

And if do not have custom adapter.Then make a loop and you must have some array or list kind of thing where values for textboxes are stored. Use them and add them before lading and display it on clcik of button. SIMPLE
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!