BTW, you get the error:
Page with this id already exists: archiveprimary!
You're adding this page two times, and you have to do it just one, in B4XMainPage.
Remove
B4XPages.AddPage("Archiveprimary", archivesummary) 'Add first page
from ArchivePrimary B4XPage_Created.