• 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

retrieve value from edittext from ListView

 
Ranch Hand
Posts: 31
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
What do you mean by "print total of EditText"?
 
Anand Gajjar
Ranch Hand
Posts: 31
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Yup, yup, yup. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic