2

I would like to display two activities side by side using the split view in my app. I have read the content of the below google's site and I am unable to implement the multi-window mode in android nougat. Have anybody implemented that?

Ref: https://developer.android.com/guide/topics/ui/multi-window.html

Senthilkumar S
  • 171
  • 3
  • 16

3 Answers3

2

You could use Fragments (see the documentation). Fragments are like sub-activities that have their own life cycle, and multiple fragments can be combined in one activity to make a multi-pane user interfaces. Fragments requires Android 3.0 or higher.

2

From Android Nougat you can display two activities side by side in same app using FLAG_ACTIVITY_LAUNCH_ADJACENT when launching a new activity.

As per doc

When you launch a new activity, you can hint to the system that the new activity should be displayed adjacent to the current one, if possible. To do this, use the intent flag FLAG_ACTIVITY_LAUNCH_ADJACENT. Passing this flag requests the following behavior:

If the device is in split-screen mode, the system attempts to create the new activity next to the activity that launched it, so the two activities share the screen. The system is not guaranteed to be able to do this, but it makes the activities adjacent if possible. If the device is not in split-screen mode, this flag has no effect.

Android Developer
  • 9,157
  • 18
  • 82
  • 139
1

Split view or multi-window mode is not meant for activities with an app. This new feature, introduced in Android Nougat, enables display of 2 different apps at the same time.

AFAIK, Android does not currently support displaying 2 activities side by side within an app. However, you may be looking for fragments that can be placed side-by-side in an activity as described here.

Prodigy
  • 61
  • 8