Android Tutorial Android home screen widgets tutorial - part I

Status
Not open for further replies.

Martin Larsen

Active Member
Licensed User
Longtime User
You mean EditText, right?

No, I actually mean TextView.

Here is a list of supported supported controls:


It would be awesome if B4A would implement at least the most important one from the list above.

I would like to make something akin to the widget from Google Keep.
 

VictorTandil

Member
Licensed User
Longtime User
You can draw text with Canvas.DrawText.

Hi. I would like to know how to initialize Canvas in a Panel or an ImageView within the Widget, since the actual views are not declared in the section "Process Globals"
 

Fulvio75

Well-Known Member
Licensed User
Hello,
I have a problem with the widget, I followed your tutorial and copied the code to create my widget, but sometimes when I try to open my app with the widget displayed on the phone the application does not start and remains black phone screen.
To allow the application to start I have to flip the widget from the screen empty the phone cache and restart the application, in this way it starts.
If I put the widget on the display the first time the application is restarted, it starts then closing it and reopening it opens the black screen.
The situation improves if I put in the code:
B4X:
Sub Service_Start (StartingIntent As Intent)

If RV.HandleWidgetEvents (StartingIntent) Then Return
Sleep (0)
Service.StopAutomaticForeground

End Sub

lines

B4X:
Sleep (0)
Service.StopAutomaticForeground

the problem occurs more rarely, you can give me some help
Thank you
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…