phoneGap原生应用中的Android手机轮换问题

Sha*_*kot 1 android screen-rotation cordova

我是Java android开发的新手.所以我的应用程序存在问题.

我用phoneGap opensource和Jquery移动框架构建了一个Android应用程序.这通常很好看.

但问题是......当我在运行应用程序后尝试旋转手机时,意外的应用程序正在关闭.

它不仅适用于我的手机,也适用于每款Android手机.

我真的想删除应用程序上的屏幕旋转.

希望你能理解

请帮帮我....

Jon*_*Jon 10

我可能有同样的问题 - 旋转崩溃.我不认为我从教程中复制了AndroidManifest.xml.我没有添加

 android:configChanges="orientation|keyboardHidden" 
Run Code Online (Sandbox Code Playgroud)

到第1次活动.看我之前和之后:

之后(工作):

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".App"
        android:label="@string/app_name"  android:configChanges="orientation|keyboardHidden">
        <intent-filter>
Run Code Online (Sandbox Code Playgroud)

之前(旋转时崩溃):

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".App"
        android:label="@string/app_name">
        <intent-filter>
Run Code Online (Sandbox Code Playgroud)

不确定您是否真的要修复屏幕或停止崩溃,但如果您想修复纵向或横向,您可以这样做:

    <application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".App"
        android:label="@string/app_name"  android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="landscape" >
        <intent-filter>
Run Code Online (Sandbox Code Playgroud)