Dim Canvas1 As Canvas
Dim x1,y1 As Int
Dim Text As String
Text="Some Thing Write Here"
x1=10
y1=10
Canvas1.DrawText(Text,x1,y1,Typeface.STYLE_ITALIC,Colors.Black,"LEFT")
Dim Canvas1 As Canvas
Canvas1.Initialize(Panel1) ' <---
Dim x1,y1 As Int
Dim Text As String
Text="Some Thing Write Here"
x1=10
y1=10
Dim tf As Typeface
tf.CreateNew(Typeface.DEFAULT, Typeface.STYLE_ITALIC)
Canvas1.DrawText(Text, x1, y1, tf, 16, Colors.Black, "LEFT")
Dim Canvas1 As Canvas
Canvas1.Initialize(Panel1) ' <---
Dim x1,y1 As Int
Dim Text As String
Text="Some Thing Write Here"
x1=10
y1=10
Dim tf As Typeface
tf.CreateNew(Typeface.DEFAULT, Typeface.STYLE_ITALIC)
Canvas1.DrawText(Text, x1, y1, tf, 16, Colors.Black, "LEFT")
(Exception) java.lang.Exception: java.lang.RuntimeException: Object should first be initialized (Typeface).
Error occurred on line: 874 (ObjQuestion)
java.lang.RuntimeException: Object should first be initialized (Typeface).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.example.objquestion._drawtext(objquestion.java:1050)
at b4a.example.objquestion._setcanvas(objquestion.java:2456)
at b4a.example.objquestion._setquestionandoptions(objquestion.java:688)
at b4a.example.objquestion._designercreateview(objquestion.java:497)
at b4a.example.test$ResumableSub_GetQuestionNumbers.resume(test.java:255)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:250)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6892)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
(Exception) java.lang.Exception: java.lang.RuntimeException: Object should first be initialized (Typeface).