printing test

gjoisa

Active Member
Licensed User
Longtime User
Hello !
I am confused about printing some text in a activity. Just we did "Form1.DrawChars "xyz" in Basic 4 PPC , How to write code in Android ?:sign0085:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
First you can use Labels instead of drawing the characters yourself.
If you do want to draw:
B4X:
Sub Globals
    Dim Canvas1 As Canvas
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Activity.LoadLayout(...)
    Canvas1.Initialize(Activity)
    Canvas1.DrawText("This is some text", 100dip, 100dip, Typeface.DEFAULT, 14, Colors.White, "LEFT")
    Activity.Invalidate 'refresh the activity
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…