Android Question Click a button on another page

JOTHA

Well-Known Member
Licensed User
Longtime User
Hello community,

I want to click a button on another page (with B4XPages) via code 1 time per minute.

The button is in a class called "Modul_30".
The button is called "L30_SwiftButton_02".
If I click the button with "L30_SwiftButton_02_Click" on this page, everything works.

But when I click this button with "M30.L30_SwiftButton_02_Click" from another page, the following error message is shown:
java.lang.RuntimeException: Class instance was not initialized (modul_30).

Does anyone know how I can click a button on another (non-visible) page from a visible page?

Thank you in advance for your tips and help.
 

Mahares

Expert
Licensed User
Longtime User
how I can click a button on another (non-visible) page from a visible page?
I have this code in B4XMainPage. P4 is initialized in B4XMainPage. You probaly have to declare P4 as public to access it from other pages other than B4XMainPage
B4X:
Sub lbl_Click
    B4XPages.MainPage.P4.bxChart_click
End Sub
I have this code in P4:
B4X:
Private bxChart As Button
Sub BxChart_Click
    Log("hello")
End Sub
If I click on the lbl in B4XMainPage, I get: Hello
 
Last edited:
Upvote 1
Top