From the Android Developer link .
To make changes in UI or separate layout which should be used on Multiple-window activate.
We can check if activity is in Multiple-window by following way
- From activity
Activity.isInMultiWindowMode()
Call to find out if the activity is in multi-window mode.
eg. To check in Activity if its multiple window than header(or any view should have Red background color if its not in multiple window thn it should be Green background color)
headerView.setBackgroundColor(inMultiWindow()?Color.RED:Color.GREEN);
using inMultiWindow()
replacing Fragment is also possible
- To get Callback on Multiple-Window Activation.
From Activity onMultiWindowChanged
method is available to handle runtime changes on this method callback.System will give callback on this method whenever the activity goes into or out of multi-window mode with boolean
value.With the help of sample link & android developer link
@Override
public void onMultiWindowChanged(boolean inMultiWindow) {
super.onMultiWindowChanged(inMultiWindow);
headerView.setBackgroundColor(inMultiWindow ? Color.RED : Color.GREEN);
// here we can change entire fragment also.
//If multiple window in than seperate and for multiple window out different
}
Will keep updating if I get anything else.