Android Question can stdActionBar count to 10?

anOparator

Active Member
Licensed User
Longtime User
Am using
B4X:
    File.WriteString(File.DirRootExternal, vp.currentPage  & ".txt", stry(vp.currentPage).Text)
from
B4X:
 Activity.AddMenuItem("Save", "save")
for 11 pages.
Pages 1 thru 10 are saved but page 10 gets saved as a blank page. This happens on two emulators and on a device.

I thought I had it all fixed, but no. Please tell me where the problem was typed. (probably something in the array statement).

Thanks for any pointers.
 

Attachments

  • testStdActionBar.zip
    22.2 KB · Views: 100

mangojack

Well-Known Member
Licensed User
Longtime User
Unsure if this solves problem ... again found the your example hard to follow.

In Process Globals you have ..
B4X:
Private stry(11) As EditText

Then in Activity Create ..
B4X:
stry = Array As EditText(stry0, stry1, stry2, stry3, stry4, stry5, stry6, stry7, stry8, stry9, stry10)
stry(10).Initialize("stry")   '@@  Remove this Line

Remove the last line of above code.
 
Last edited:
Upvote 0

anOparator

Active Member
Licensed User
Longtime User
yes it does solve saving page 11, thanks a bunch.
I had put that line there because of a Warning about initializing stry.

I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA
 
Last edited:
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
I'd appreciate all comments on how my example was hard to follow (too many remmed lines, the non-relevant Button (x) Subs) , as I approach the intermediate stage of B4x syntax. TIA

I know the final product would be a tidy package ... but mainly the excessive rem lines in this and other examples. I did not even try the buttons.
Possibly renaming to reflect View Types .. eg: edtPages , edtArrayPages or similar for EditTexts.

Unsure if this was just due to testing .. but you define 11 Edit texts, populate them and then assign them to array of edit texts ?. Maybe there's a good reason to do so.
 
Upvote 0
Top