hi
i want to get text from my label in my widget but i dont know how, please help me !!
something like if label1.text = "1" then 'do something else 'do something end if
i want to get text from my label in my widget but i dont know how, please help me !!
something like if label1.text = "1" then 'do something else 'do something end if
B4X:
'Service module
Sub Process_Globals
Dim rv As RemoteViews
Dim imageFiles() As String
Dim currentImage As Int
Dim Timer1 As Timer
End Sub
Sub Service_Create
rv = ConfigureHomeWidget("L1", "rv", 0, "שכרניק",True)
Timer1.Initialize("timer1",1000)
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
Sub rv_RequestUpdate
SetTime
rv.UpdateWidget
Timer1.Enabled = True
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub Service_Destroy
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
rv_RequestUpdate
End Sub
Sub SetTime
rv.SetText("time", DateTime.Time(DateTime.Now))
End Sub
Sub play_Click 'here is the problem !! i dont know how to get the text of label1 !
If label1.text = "1" Then
rv.SetImage("play", LoadBitmap(File.DirAssets, "pause.png"))
rv.SetText("label1", "0")
Else
rv.SetImage("play", LoadBitmap(File.DirAssets, "play.png"))
rv.SetText("label1", "q")
End If
Timer1.Enabled = True
End Sub
Sub stop_Click
End Sub'