LG Wing
FAQ
FAQ
-
Q1 How do I check the on/off state of a Second Screen? 열기
-
Q2 Can I turn on or off only a Second Screen? 열기
Since you can turn it on or off with the Main Screen in the Swivel Mode, it is not possible to turn it on or off only a Second Screen.
-
Q3 I want to use both the Main Screen and Second Screen in my app, how could I do it? 열기
// Please refer to the sample app code.
Sets the launchDisplayId of ActivityOptions where activity should be launched
•https://developer.android.com/reference/android/app/ActivityOptions.html#setLaunchDisplayId(int)
•https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK
•https://developer.android.com/guide/topics/manifest/activity-element#lmodeEx)
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
ActivityOptions options = ActivityOptions.makeBasic();
options.setLaunchDisplayId(/*displayId*/);
startActivityAsUser(intent, options.toBundle(), /*userId*/); -
Q4 How can I distinguish the existing cover display and the Second Screen of Wing? 열기
You can call public static int getMultiDisplayType() of DisplayManagerHelper and check the return value.
DisplayManagerHelper.TYPE_COVER
DisplayManagerHelper.TYPE_SWIVELDisplayManagerHelper.java
/**
* Multi Display Type : Unknown Type
* @lgapi
*/
public static final int TYPE_INVALID = -1;
/**
* Multi Display Type : Cover Type
* @lgapi
*/
public static final int TYPE_COVER = 0;
/**
* Multi Display Type : SWIVEL Type
* @lgapi
*/
public static final int TYPE_SWIVEL = 1; -
Q5 Is there a way to identify the Second Screen ID? 열기
You can call public int getMultiDisplayId() of DisplayManagerHelper and check the Second Screen ID value.
Ex)
import com.lge.display.DisplayManagerHelper;
DisplayManagerHelper mDisplayManagerHelper = new DisplayManagerHelper(mContext);
if (DisplayManagerHelper.isMultiDisplayDevice()) {
mDisplayId = displayManagerHelper.getMultiDisplayId();
} -
Q6 Is there a way to check if LG MultiScreen SDK is supported? 열기
Use getSystemAvailableFeatures() and hasSystemFeature(String) with the "com.lge.multiscreen" feature to check if a device supports LG Multiscreen SDK.
Ex)
private boolean hasLGMultiScreenFeature(){
String feature = "com.lge.multiscreen";
PackageManager pm = getPackageManager();
if (pm.hasSystemFeature(feature)) {
//Multi Display is supported
return true;
} else {
return false;
}
}
You can retrieve the on/off state of a Second Screen with getState() of the android.view.Display class, as shown in the following sample code.
https://developer.android.com/reference/android/view/Display.html#getState()
Ex)
if (DisplayManagerHelper.isMultiDisplayDevice()) {
int mDisplayId = mDisplayManagerHelper.getMultiDisplayId();
Display mSecondaryDisplay = mDisplayManager.getDisplay(mDisplayId);
int mSecondaryDisplayState = mSecondaryDisplay.getState();
}