![](/img/trans.png)
[英]Issues with jQuery load() in Phonegap (2.8.1) - Android (3.x and 4.x)
[英]Android 4.x orientation with phonegap
我有一個帶phonegap 1.3和jquerymobile 1.0的網絡應用程序,在所有android版本上都能很好地工作,但在4.0上運行。事實上,如果更改方向,該應用程序將強制關閉,沒有錯誤,也沒有logcat錯誤。 如果以人像作品打開我的應用程序,如果我以風景作品打開,但是如果我嘗試切換關閉
這是我的代碼:
import android.os.Bundle;
import com.phonegap.DroidGap;
public class MYActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
我當然有
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="sensor"
明顯!
感謝幫助
嘗試添加以下內容:
android:configChanges="orientation|screenSize|keyboardHidden"
作為您的配置更改參數,以查看它是否可以解決您的問題。
我遇到了相同的輪換問題,並將應用程序升級到最新版本的sdk 4.03,並且上述配置發生了更改。 我的清單如下所示:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="13" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".Ordering"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- ZXing activities -->
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.google.zxing.client.android.encode.EncodeActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/share_name" >
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.ENCODE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.