Android Question How to code buttons, labels and other items under AddView menu in Visual Designer

Pavan Krishna Mulpur

Member
Licensed User
Longtime User
Hi all,

I understand that after inserting an object such as a button, label, checkbox and so on on the designer you need to write some amount of code for that object to work on your smart phone/tablet Android screen. I've a left button a right button and few items on my designer screen. I've selected Generate Members from Tools menu and selected the option Activity, Click, button click for all the items.
This has produced some code on the B4A main screen. Now what code do I write here to make these items work when I execute my code.

Is there any tutorial which tells how to code to bring the buttons and other objects to life?
Please help.


Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub OFF_CheckedChange(Checked As Boolean)

End Sub

Sub Item4_ItemClick (Position As Int, Value As Object)

End Sub

Sub Item3_ItemClick (Position As Int, Value As Object)

End Sub

Sub Item2_ItemClick (Position As Int, Value As Object)

End Sub

Sub Item1_ItemClick (Position As Int, Value As Object)

End Sub

Sub btnRight_Click

End Sub

Sub btnDown_Click

End Sub

Sub Activity_Click

End Sub


Thank you.

Regards,

Pavan.
 

klaus

Expert
Licensed User
Longtime User
It would be easier to help you if you explained what you want to do.

You should have a look at the B4A Beginner's Guide.

First you must save the layout file: With 'Main' as the name.
Then you must load the layout file in:
Sub Activity_Create
Activity.LoadLayout("Main")
End Sub

Then when you run the program and you 'click' onto the Right button the Click event will be raised by the operating system and the code in this routine below will be executed.
Sub btnRight_Click
'here you must enter the code you want to be exevuted when you click onto the Right button
End Sub
 
Last edited:
Upvote 0
Top