Artur2024 New Member Nov 12, 2021 #1 Hey I'm still studying. I used it Android Tutorial Widget Layout (Resizable, Adaptive) after modification, it displayed the number of days from the date (Widget_4x1.bas, line 21). By clicking on Label, I would like to change the date. I can't open the date change window. I need help with how to display the date to be changed (it's not about saving). I greet arthur Attachments Widget Test.zip Widget Test.zip 135.3 KB · Views: 542
Hey I'm still studying. I used it Android Tutorial Widget Layout (Resizable, Adaptive) after modification, it displayed the number of days from the date (Widget_4x1.bas, line 21). By clicking on Label, I would like to change the date. I can't open the date change window. I need help with how to display the date to be changed (it's not about saving). I greet arthur
Artur2024 New Member Nov 13, 2021 #2 Maybe I'll describe the problem better. In this example Widget Layout (Resizable, Adaptive), how can I open B4XPages by clicking on the widget? Upvote 0
Maybe I'll describe the problem better. In this example Widget Layout (Resizable, Adaptive), how can I open B4XPages by clicking on the widget?
Erel B4X founder Staff member Licensed User Longtime User Nov 14, 2021 #3 Artur2024 said: how can I open B4XPages by clicking on the widget? Click to expand... You can call StartActivity(Main), however on Android 10+, starting an activity from a service is only possible with the special "draw over apps" permission (I haven't tested it with widgets so there might be a special case here). Upvote 0
Artur2024 said: how can I open B4XPages by clicking on the widget? Click to expand... You can call StartActivity(Main), however on Android 10+, starting an activity from a service is only possible with the special "draw over apps" permission (I haven't tested it with widgets so there might be a special case here).
Artur2024 New Member Nov 21, 2021 #4 Thank you Erel. Initially I tried "StartActivity" but .... The solution is simple when someone tells you what to do Add to Widget_4x1 B4X: Copy Private Sub Label2_Click StartActivity (Activity2) End Sub Public Sub SetLabel2 (text As String) rv.SetText ("Label2", text) rv.UpdateWidget End Sub Add a new Activity (with me "Activity2") After clicking the Button (in "Activity2") we can change label2. in the new Activity: B4X: Copy Private Sub Button1_Click Dim t As String = EditText1.Text CallSub2 (Widget_4x1, "SetLabel2", t) Activity.Finish End Sub If someone needs, an example is in the attachment. Click on Label2 (the second one is in Widget_4x1). Works in B4A. ps. I have several dozen years of programming experience, but I am still learning B4X. Attachments Widget Test.zip Widget Test.zip 155.2 KB · Views: 532 Upvote 0
Thank you Erel. Initially I tried "StartActivity" but .... The solution is simple when someone tells you what to do Add to Widget_4x1 B4X: Copy Private Sub Label2_Click StartActivity (Activity2) End Sub Public Sub SetLabel2 (text As String) rv.SetText ("Label2", text) rv.UpdateWidget End Sub Add a new Activity (with me "Activity2") After clicking the Button (in "Activity2") we can change label2. in the new Activity: B4X: Copy Private Sub Button1_Click Dim t As String = EditText1.Text CallSub2 (Widget_4x1, "SetLabel2", t) Activity.Finish End Sub If someone needs, an example is in the attachment. Click on Label2 (the second one is in Widget_4x1). Works in B4A. ps. I have several dozen years of programming experience, but I am still learning B4X.