F Fox Active Member Licensed User Longtime User Jul 28, 2011 #1 Hy if i use this for showing the current time in an label i get an error: Dim now As Long lbl_Time.Typeface = ProgrammFont lbl_time = DateTime.Time(now) lbl_time.Typeface = ProgrammFont this is the error: Compiling code. 0.06 Generating R file. 0.00 Compiling generated Java code. Error B4A line: 617 lbl_time = DateTime.Time(now) javac 1.6.0_25 src\com\new\c\main.java:1173: inconvertible types found : java.lang.String required: android.widget.TextView _lbl_time.setObject((android.widget.TextView)(anywheresoftware.b4a.keywords.Common.DateTime.Time(_now))); ^ 1 error how can i show the current time in an label? I don't understand this because it should work.... Last edited: Jul 28, 2011
Hy if i use this for showing the current time in an label i get an error: Dim now As Long lbl_Time.Typeface = ProgrammFont lbl_time = DateTime.Time(now) lbl_time.Typeface = ProgrammFont this is the error: Compiling code. 0.06 Generating R file. 0.00 Compiling generated Java code. Error B4A line: 617 lbl_time = DateTime.Time(now) javac 1.6.0_25 src\com\new\c\main.java:1173: inconvertible types found : java.lang.String required: android.widget.TextView _lbl_time.setObject((android.widget.TextView)(anywheresoftware.b4a.keywords.Common.DateTime.Time(_now))); ^ 1 error how can i show the current time in an label? I don't understand this because it should work....
nfordbscndrd Well-Known Member Licensed User Longtime User Jul 29, 2011 #2 See this page in the Documentation Wiki. The routine there also shows battery level, both of which are very handy to have in programs which a person may be running for more than a little while. Upvote 0
See this page in the Documentation Wiki. The routine there also shows battery level, both of which are very handy to have in programs which a person may be running for more than a little while.
A admac231 Active Member Licensed User Longtime User Jul 29, 2011 #3 You aren't specifying the text property of lbl_time. The third line of your code should read: Code: Copy lbl_time.Text = DateTime.Time(now) Upvote 0
You aren't specifying the text property of lbl_time. The third line of your code should read: Code: Copy lbl_time.Text = DateTime.Time(now)