Cordova 如何限制sencha touch中的启动方法调用

Cordova 如何限制sencha touch中的启动方法调用,cordova,sencha-touch,Cordova,Sencha Touch,我试图通过使用onOrientationchange来实现sencha touch应用程序中的定向功能 然后,在设备屏幕上运行应用程序时,旋转并重定向到当前工作屏幕的主屏幕 onOrientationchange: function(viewport, orientation, width, height) { if(width > height){ orientation = 'landscape'; } else { orient

我试图通过使用onOrientationchange来实现sencha touch应用程序中的定向功能 然后,在设备屏幕上运行应用程序时,旋转并重定向到当前工作屏幕的主屏幕

onOrientationchange: function(viewport, orientation, width, height) {
    if(width > height){
        orientation = 'landscape';
    }
    else {
        orientation = 'portrait';
    }
    if(orientation == 'landscape' && this.getMyContainer() != undefined ){
        //remove all the items from the main panel
        this.setOrientation(Ext.widget(currentLayout));
    }
    if(orientation == 'portrait' && this.getMyContainer() != undefined){
        this.setOrientation(Ext.widget(currentLayout));
    }
},
启动:函数(){}

我的问题是,在设备中旋转屏幕时,launch()在所有情况下都会调用。 请建议我解决我的问题。
感谢您的高级支持。

您是否尝试过使用phonegap

   onFirstViewRouteLoad: function() {
     if(Ext.os.is.Android || Ext.os.is.iOS ){
        navigator.screenOrientation.set('portrait');
    }

    if('firstview') {

        myApp.util.showActiveItem(Ext.Viewport, 'firstview');
    }
    else {

         myApp.util.showActiveItem(Ext.Viewport, {xtype: 'firstview'});
    }
},

后面是post

实际上我的问题不是这样的,我在第二视图中,然后在控制器上重新加载启动功能。我更新了我的答案。我将在上面给出的运行时设置方向。ShowActiveItem,有助于在视口中设置视图。试试这个。嗨,伙计们,我终于找到了解决方案。请更新android manifest.xml文件。很好,试试看,终于找到了