2013-01-04 113 views
-1

这个问题在这里被问了3次,但没有回答。Phonegap Android应用程序重新启动而不是恢复

我在Android设备2.3.6上使用Phonegap 2.1(Galaxy SII) 我也在使用AdMob Phonegap插件。

那么问题是一样的其他人说:

  • 当试图恢复通应用程序图标的应用程序重新启动,即使在内存it's
  • 当通过直通任务管理器它通常恢复

我的主要活动

public class testApp extends DroidGap 
{ 

    @Override 
    public void onCreate(Bundle savedInstanceState) 
    { 

     super.onCreate(savedInstanceState); 
     super.setIntegerProperty("splashscreen", R.drawable.splash); 
     setIntegerProperty("loadUrlTimeoutValue", 60000); 
     super.loadUrl("file:///android_asset/www/index.html",5000); 

    } 
} 

的manifest.xml

<application android:icon="@drawable/icon" android:label="@string/app_name" 
    > 
    <activity android:name="testApp" android:label="@string/app_name" 
      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" 
      android:windowSoftInputMode="adjustPan"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name="com.google.ads.AdActivity" 
       android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" 
       /> 
</application> 

感谢您对清单中的任何意见

+0

可能重复[Phonegap Android应用程序重新启动而不是恢复,虽然它没有被操作系统杀死](http://stackoverflow.com/questions/10122449/phonegap-android-application-restarting-instead-of-resuming - 虽然没有) –

回答

0

地方android:launchMode="standard"testApp活动

+0

以上答案对我而言并不适用。我的应用程序仍然重新启动后,按下应用程序的主页按钮后恢复。 – NarendraJi

1

如果你“不保留活动”的开发者选项部分选择在设置应用程序,那么无论您将清单配置为什么,所有活动在用户不使用时都会被销毁。这适用于PhoneGap应用程序和本机应用程序。

相关问题