mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:32:39 +08:00
Solve the issue : can't build android portrait project from binary template in Creator.
This commit is contained in:
+2
-8
@@ -45,12 +45,7 @@ public class AppActivity extends Cocos2dxActivity{
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(nativeIsLandScape()) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
} else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||
}
|
||||
|
||||
if(nativeIsDebug()){
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
@@ -76,8 +71,7 @@ public class AppActivity extends Cocos2dxActivity{
|
||||
public static String getLocalIpAddress() {
|
||||
return hostIPAdress;
|
||||
}
|
||||
|
||||
private static native boolean nativeIsLandScape();
|
||||
|
||||
private static native boolean nativeIsDebug();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user