我创建了一个扩展Activity的MainActivity(也尝试扩展CordovaActivity),并希望在PhoneGap应用程序启动时立即显示此活动。问题在于,无论我尝试在各种配置中进行调整等,清单文件都会被部分覆盖,并显示加载www \ index.html的webview。
我可能不需要这个应用程序的原始PhoneGap功能,但我想使用build.phonegap.com来构建和部署它。
重写Cordova webview类以使其以新意图启动我的活动可能是一个解决方案,我想,但是必须有另一种(配置)方式吗?
AndroidManifest.xml(在build.phonegap.com之前):
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="com.mystuff.myapp" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:allowBackup="true" android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="com.mystuff.myapp.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
</manifest>
AndroidManifest.xml(在build.phonegap.com之后,在ManifestViewer手机上):
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="42"
android:versionName="1.0.0"
android:windowSoftInputMode="stateUnspecified|adjustPan"
android:installLocation="auto"
package="com.mystuff.myapp">
<supports-screens
android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:resizeable="true"
android:xlargeScreens="true"/>
<uses-permission
android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:label="@2130968576"
android:icon="@2130837504"
android:debuggable="true"
android:hardwareAccelerated="true">
<activity
android:label="@2130968576"
android:name=".MyApp"
android:screenOrientation="unspecified"
android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateUnspecified|adjustUnspecified">
<intent-filter>
<action
android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:label="@2130968576"
android:name="com.phonegap.DroidGap">
<intent-filter/>
</activity>
</application>
<uses-sdk
android:minSdkVersion="7"/>
</manifest>
答案 0 :(得分:3)