last day (15 days later) » 

12:34 PM
1
A: Adding multiple rows into ListView and saving into SimpleAdapter without deletion

Kalpesh Patelput method on HashMap Maps the specified key to the specified value. If specified key is already present then it will update value for specified key. As you are adding same object in ArrayList. Your ArrayList will have two entries of same object with modified value. Replace your onClick method ...

 
Could you show a code example please? I don't fully understand what you mean by creating a second HashMap.
 
Please check my edit.
 
Hello, I have another problem using this method. Now when I add the new row it will save. Then when I click the add_task Button that will take me to the to the Add_Item activity to add a new row using the button, it will delete the previous row and add the newest one. I would like to keep all the rows that have been added
It isnt saving the rows if I add an intent that goes back to the MainActivity, I will repost the new code.
 
Actually your approach of doing this is wrong.
 
What is a better approach?
 
12:34 PM
I will update my Answer.
 
Hello, could you go into more detail on case 2? I don't fully understand the technical lingo, more code examples would help a lot. Thanks again.
I understand you mean ` DataStorage data = new DataStorage(Add_Item.this.TaskNameET.getText().toString(), Add_Item.this.SpinType.getSelectedItem().toString(), Add_Item.this.DateTimeET.getText().toString()); ` but then to create an Arraylist<Data> into mainactivity does what exactly?
 
Let me first clear few things.
you have a some data in your MainActivity which you want to show in Add_Item activity.
And in Add_Item Activity you user can add some more data to your old data from Main Activity.
and when user goes back to MainActivity you want your old data + new data from Item_Add Activity.
Is it true?
If not please explain what are you trying to do?
 
 
8 hours later…
9:07 PM
Hello, the application I am trying to build is fairly simple. I have ListView in MainActivity, and a button in Add_Item that will take data that was enetered into the TextView's and put them into the ListView. Each time that button is pressed, the new data will be added to the ListView and stored there without being deleted or rewritten with new data. The storage can be temporary, I dont need to create a sql database for storage. Just until the app is closed.
 

last day (15 days later) »