Even though I have been using B4A for almost 10+ days, this is my first post at this forum as all of my questions that i had, have already been asked and responded to.
I am at the last stages of my first big application and all of a sudden i have hit a dead end and do not know how to go about it.
I have used multiple code samples from this amazing site and supporting people and staff. So thanks to all of you.
My problem is that i am creating a list of players to create a score card. User will be able to add players that they have defined. Every time a player is added in the list few labels are added in the list (Custom List View - CLV [CustomListView 1.16] - also downloaded from this site and made some modifications to it as per my need).
No issue so far.
One of the controls in the CLV is the table (Table [TableV1_36] - yet another reuse of code from this site)
The table has 20 columns and takes at least 8 seconds to be loaded. My plan was that once I have created a table I will save it in a List object and when new player is added I will extract it from the list and assign to a newly created and initialized variable so user does not have to wait for 8-10 seconds every time they add a new player.
sample code is as below:
(I know it is logical that this new tbl variable that i get from lstCtrlTable is the same as original)
Now when i make changes to the content of the table the original table gets updated.
I have also tried RandomAccessFile write object and then read it but it did not work properly either as suggested in http://www.b4x.com/android/forum/threads/copying-an-object-not-just-a-reference.12816/
It gives a Java Null Pointer error after i Read it back and initialize it:
Summary:
I need to know if i can make a copy of this variable and use it again and again with every new player added in my app. All the logic of my app for calculating running scores is built around this table.
Thanks in adv
I am at the last stages of my first big application and all of a sudden i have hit a dead end and do not know how to go about it.
I have used multiple code samples from this amazing site and supporting people and staff. So thanks to all of you.
My problem is that i am creating a list of players to create a score card. User will be able to add players that they have defined. Every time a player is added in the list few labels are added in the list (Custom List View - CLV [CustomListView 1.16] - also downloaded from this site and made some modifications to it as per my need).
No issue so far.
One of the controls in the CLV is the table (Table [TableV1_36] - yet another reuse of code from this site)
The table has 20 columns and takes at least 8 seconds to be loaded. My plan was that once I have created a table I will save it in a List object and when new player is added I will extract it from the list and assign to a newly created and initialized variable so user does not have to wait for 8-10 seconds every time they add a new player.
sample code is as below:
B4X:
pnl.Initialize("")
pnl.RemoveView
pnlPlayers.AddView(pnl, pnlScoreCard.Left, 0, pnlScoreCard.Width, lbl_Strokes.Height)
pnl.Visible=True' tbl.Initialize(pnl,"", iMaxHolesPerRound+2, Gravity.CENTER_HORIZONTAL, False)
tbl.AddToView(pnl,0,0,pnl.Width,pnl.Height)
tbl= lstCtrlTable.Get(0)
(I know it is logical that this new tbl variable that i get from lstCtrlTable is the same as original)
Now when i make changes to the content of the table the original table gets updated.
I have also tried RandomAccessFile write object and then read it but it did not work properly either as suggested in http://www.b4x.com/android/forum/threads/copying-an-object-not-just-a-reference.12816/
It gives a Java Null Pointer error after i Read it back and initialize it:
B4X:
tbl.Initialize(pnl, "", iMaxHolesPerRound+2, Gravity.CENTER_HORIZONTAL, False)
tbl.AddToView(pnl,0,0,pnl.Width,pnl.Height)
Summary:
I need to know if i can make a copy of this variable and use it again and again with every new player added in my app. All the logic of my app for calculating running scores is built around this table.
Thanks in adv