Android Question Is StartActivity() the correct way to open app from widget for B4XPages project ?

AnandGupta

Expert
Licensed User
Longtime User
To start the app from the widget, I used below code in WidgetReceiver.bas,
B4X:
Private Sub Button1_Click
    StartActivity(Main)
End Sub
where Button1 is a button on the widget.

Is this the correct way for B4XPages project ?
I mean since this is B4XPages, so there may be a better way.
 
Solution
It is the correct way, however unless you request the special "draw over apps" permission, you cannot start an activity while the app is in the background.
Top