Wish Start an Activity alongside another

agraham

Expert
Licensed User
Longtime User
I suggest that there is a variant of StartActivity that sets FLAG_ACTIVITY_LAUNCH_ADJACENT in the starting intent so that an Activity can be displayed alongside the calling Activity in split screen or multi-window mode. Having Activity.isInMultiWindowMode() available would also be useful.

There are most probably further negative ramifications in being able to do this which I cannot currently explore.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is quite simple to start an activity yourself:
B4X:
Sub Activity_Click
    Dim in As Intent = GetActivityIntent(Activity2)
    'add flags here
    StartActivity(in)
End Sub

Sub GetActivityIntent (act As Object) As Intent
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Dim in As JavaObject
    in.InitializeNewInstance("android.content.Intent", Array(ctxt, act))
    Return in
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…