Android Question TableView refresh?

giga

Well-Known Member
Licensed User
Longtime User
This is what I am doing.

B4X:
Sub Button1_Click
List1.Add(EditText1.Text)
EditText1.Text = ""
ListView1.AddSingleLine(EditText1.Text)
File.WriteList(File.DirRootExternal,"test.txt",List1)


its adds to the file successful.
and listview successful.

but I have to close the app and reopen then it shows.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You must do something wrong... It works... See Example...

At begin the listview (NOT tableview!) is filled with 3 items. If you click on button the text from edittext is added to the listview. And it DIRECTLY appears. Without need to reopen.
 

Attachments

  • listviewtest.zip
    7.5 KB · Views: 186
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
BTW

you wrote

B4X:
EditText1.Text = ""
ListView1.AddSingleLine(EditText1.Text)

The 1st line EMPTIES the edittext and the secondline adds an (empty) string to the listview. BUT is is added...

Try

B4X:
ListView1.AddSingleLine(EditText1.Text)
EditText1.Text = ""
 
Upvote 0

giga

Well-Known Member
Licensed User
Longtime User
You must do something wrong... It works... See Example...

At begin the listview (NOT tableview!) is filled with 3 items. If you click on button the text from edittext is added to the listview. And it DIRECTLY appears. Without need to reopen.

My apologizes, I said TableView(B4J) instead of ListView. I will revisit my code closer THANKS DonManfred.
 
Upvote 0

giga

Well-Known Member
Licensed User
Longtime User
There is also a TableView in B4A. You wrote in the B4A-Part of the forum and therefore i thought you have problems with B4A, not B4J...

The problem in your code seems the wrong order of your commands. See Post in top of your lastpost ...

I am running a TableView project in B4J and another ListView project in B4A. Too many projects not enough brain power.

I got confused between the two. The problem was the order. THANKS
 
Upvote 0
Top