I added a couple more columns and managed to get everything saving well but after about 10 items the ListView starts repeating entire entries and the quantity buttons affect both rows. Is this something I'm doing wrong I see on the internet some people say ListView just starts reusing things??? I need to have like a virtually infinite row of stuff it's an inventory app. Will writing my own custom class even help me fix this problem if it's because of the ListView itself? What should I do?
@@adamthefirst401 yes it's a bit of a learning curve but you just gotta make it into a recycler view.. hang on a second I'll link you the video that made me suddenly understand the behavior.
When you have an XML file open, you should see three tabs at the top right saying "Code", "Split", and "Design". Make sure to select Split to see both the code and the design.
Hello while typing item.add(item); , 'add' is highlighted in red as an error. I don't know how to resolve this error. Please let me know soon. This is for my final year project. Thanx
You probably made a typo. *items* with an S is the ArrayList. *item* is a String. Strings don't have an add function, but ArrayLists do. You may also have named your variables differently so you should check for that. What the addItem function does is add a String to an ArrayList. In your code you're calling String.add(String) which is not valid in Java.
To have more "columns" you would need to define a custom layout for each row in your ListView. Each row would have multiple TextViews side by side as the columns. Creating a custom ListView layout is covered in the 5th tutorial: ruclips.net/video/aJ8pYAtMdlU/видео.html There are multiple steps and the video covers all of them.
If I enter item and add them and close my app ... After opening this app I want to display previous item ...it means user always login and open app and don't add item repeat and repeat add only once please give me solution
You would need a way to store the items that the user added. The simplest way to do this is to save the items in the list to a file in internal storage, and whenever you go to the MainActivity, read the items in the file and add them to the ListView. These are two tutorials: *Writing to Storage: **ruclips.net/video/wc4p6sYR3B4/видео.html* *Reading from Storage: **ruclips.net/video/0R3mT6L5F6s/видео.html*
You can check out this tutorial on custom listview layouts: ruclips.net/video/aJ8pYAtMdlU/видео.html You would need to have a layout with an imageview, and simply pass the image as a parameter when you add new items to your list.
I added a couple more columns and managed to get everything saving well but after about 10 items the ListView starts repeating entire entries and the quantity buttons affect both rows. Is this something I'm doing wrong I see on the internet some people say ListView just starts reusing things??? I need to have like a virtually infinite row of stuff it's an inventory app. Will writing my own custom class even help me fix this problem if it's because of the ListView itself? What should I do?
Did you ever find a solution?
@@adamthefirst401 yes it's a bit of a learning curve but you just gotta make it into a recycler view.. hang on a second I'll link you the video that made me suddenly understand the behavior.
@@humble_roots thanks
@@humble_roots Could you link the video if you still have it? Thanks!
Where is the timestamp to jump to that you mentioned at the beginning?
EDIT: I found it at 4:28
how do you have the live design on the right side of your screen?
When you have an XML file open, you should see three tabs at the top right saying "Code", "Split", and "Design". Make sure to select Split to see both the code and the design.
Hello while typing item.add(item); , 'add' is highlighted in red as an error. I don't know how to resolve this error. Please let me know soon. This is for my final year project. Thanx
You probably made a typo. *items* with an S is the ArrayList. *item* is a String.
Strings don't have an add function, but ArrayLists do. You may also have named your variables differently so you should check for that.
What the addItem function does is add a String to an ArrayList.
In your code you're calling String.add(String) which is not valid in Java.
What if my listview has more columns? how can I add a row with values for each column?
To have more "columns" you would need to define a custom layout for each row in your ListView. Each row would have multiple TextViews side by side as the columns.
Creating a custom ListView layout is covered in the 5th tutorial: ruclips.net/video/aJ8pYAtMdlU/видео.html
There are multiple steps and the video covers all of them.
If I enter item and add them and close my app ... After opening this app I want to display previous item ...it means user always login and open app and don't add item repeat and repeat add only once please give me solution
You would need a way to store the items that the user added. The simplest way to do this is to save the items in the list to a file in internal storage, and whenever you go to the MainActivity, read the items in the file and add them to the ListView.
These are two tutorials:
*Writing to Storage: **ruclips.net/video/wc4p6sYR3B4/видео.html*
*Reading from Storage: **ruclips.net/video/0R3mT6L5F6s/видео.html*
How to insert all the list view item to db in a single button click
what if i my list has image how to add that with the name
You can check out this tutorial on custom listview layouts: ruclips.net/video/aJ8pYAtMdlU/видео.html
You would need to have a layout with an imageview, and simply pass the image as a parameter when you add new items to your list.
is this java tutorial?
Yes.