Android dual screen is clone mode, if you want to display different content on the second screen, you need to customize a presentation class
1. Set Permissions First
(just start tossing for a long time no effect, later found that is not set permissions)
<!--display the System window permissions-- <uses-permission android:name= "Android.permission.SYSTEM_ALERT_WINDOW"/> <!--display addview--> <uses-permission android:name= "Android.permission.SYSTEM_OVERLAY_WINDOW" at the top of the screen/ >
2. Custom Classes
public class Differentdislay extends presentation{public differentdislay (Context outercontext, display display) { C1/>super (Outercontext,display); } @Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Setcontentview (r.layout.test); }}
3. Then this code will allow the second screen to display different content.
Displaymanager mdisplaymanager;//Screen Management class Mdisplaymanager = (Displaymanager) this.getsystemservice (Context.DISPLAY_ SERVICE);D isplay[] Displays = Mdisplaymanager.getdisplays (); if (mpresentation = = null) {mpresentation = new Differentdislay (this, displays[displays.length-1]);//displays[1] is a sub-screen Mpresentation.getwindow (). SetType ( WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); Mpresentation.show ();}
Android Dual Screen different display