Categories
- News (153)
- Support (148)
- OEM & ODM (9)
- Drivers (7)
- Instructions (18)
- SDKs & Tools (5)
- Knowledge (54)
- Solutions (13)
- Blog (24)
1.Obtain the screen on the device
DisplayManager mDisplayManager;//Screen management
Display[] displays;//Screen array
mDisplayManager =(DisplayManager)context.getSystemService(Context.DISPLAY_SERVICE);
displays =mDisplayManager.getDisplays();
2.Main display and customer display distinction
Main display:displays[0]
Customer display:displays[1]
3.Display content on the secondary screen
Implemented through Presentation, Presentation inherits Dialog.Suppose we write a DifferentDislay class that inherits from the Presentation class. Code
privateclass DifferentDislayextendsPresentation{
public DifferentDislay(ContextouterContext, Display display) {
super(outerContext,display);
//TODOAuto-generated constructor stub
}
@Override
protectedvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.diffrentdisplay_basket);
}
}
4.Turn on the customer display
DifferentDislay mPresentation =new DifferentDislay (context,displays[1]);//displays[1]is customer display
mPresentation.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
mPresentation.show();