2014-02-20 136 views
4

我创建了一个扩展Activity的MainActivity(也尝试过扩展CordovaActivity),并希望在启动PhoneGap应用程序时立即显示此活动。问题是无论我尝试在各种配置中如何调整,清单文件都会被部分覆盖,并显示加载www \ index.html的web视图。如何在PhoneGap应用启动时启动Android活动?

我可能不需要这个应用程序的原始PhoneGap功能,但我想使用build.phonegap.com来构建和部署它。

重写科尔多瓦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> 

回答

相关问题