Example usage for android.view Display FLAG_PRESENTATION

List of usage examples for android.view Display FLAG_PRESENTATION

Introduction

In this page you can find the example usage for android.view Display FLAG_PRESENTATION.

Prototype

int FLAG_PRESENTATION

To view the source code for android.view Display FLAG_PRESENTATION.

Click Source Link

Document

Display flag: Indicates that the display is a presentation display.

Usage

From source file:de.fhg.fokus.famium.presentation.CDVPresentationPlugin.java

private void addDisplay(final Display display) {
    if ((display.getFlags() & Display.FLAG_PRESENTATION) != 0) {
        getActivity().runOnUiThread(new Runnable() {
            @Override//from  ww  w. j ava2 s.com
            public void run() {
                int oldSize = getSessions().size();
                SecondScreenPresentation presentation = new SecondScreenPresentation(getActivity(), display,
                        getDefaultDisplay());
                getPresentations().put(display.getDisplayId(), presentation);
                presentation.show();
                int newSize = getPresentations().size();
                CallbackContext callbackContext = getAvailableChangeCallbackContext();
                if (oldSize == 0 && newSize == 1 && callbackContext != null) {
                    sendAvailableChangeResult(callbackContext, getPresentations().size() > 0);
                }
            }
        });
    }
}