-1

这个问题在这里被问了 3 次,但没有答案。

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

那么问题与其他人所说的相同:

  • 当尝试通过应用程序图标恢复时,即使应用程序在内存中,它也会重新启动
  • 通过任务管理器时,它会正常恢复

我的主要活动

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);

    }
}

清单.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>

谢谢你的任何建议

4

2 回答 2

1

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

于 2015-04-24T10:25:46.717 回答
0

放置android:launchMode="standard"testApp活动清单中

于 2013-01-04T09:45:08.193 回答