Categories
- News (235)
- Support (257)
- OEM & ODM (10)
- Drivers & Tools (10)
- Instructions (28)
- Troubleshooting (44)
- Knowledge (97)
- Maintainance (8)
- Blog (87)
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();