简体   繁体   中英

How to insert edittext value from custom listview into sqlite database in android

I am trying to create a VanSale model app in android. I have a form with customer name and customers item field. In the item field I have created a custom listview with 7 columns.Column contains Sl No, ItemCode, ItemName, Quantity,Discount,Rate and Amount. 5 items will shown in the list. When I pressed a add button will add 5 more items to listview. List items can be upto 100. I want to insert the each items in the listview into sqlite database. How can I done this? Is there any other easy methods to done this?

First Think, you have to learn about looping, iteration conceptual in your mind and take a practice using simply array or list data. if You already know about the sqlite database and listview, i thought you only need to made some function to get from listview using position, and another function to write into database.

Second, Listview has position parameter if you passing it into onSelectedItem method, or you can get directly from listview self and get using position, and sqlite db which you use list or array has position also.

I think its a logical question. so my answer is logical too, or you can attach your code's also here to detailing your problem, good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM