重新打开PhoneGap Android App重置?

时间:2014-02-26 13:09:12

标签: cordova background-process

好的,我已经使用Phonegap for iOS构建了一个应用程序正常工作没问题,我现在将此应用程序移至Android。

这或多或少有效,除了我必须重新做很多CSS之外,我想我必须做的是RWD。我用于iOS的后台插件只是为iOS构建的,所以我从android构建中删除它并构建一个新的。

这可以看到所有的工作,应用程序在后台工作正常,当你从打开的应用程序列表返回它。但是,当您加载应用程序或从应用程序链接重新加载应用程序时,它似乎重置/重新加载应用程序并从屏幕上擦除所有信息?

我已经移动到我的Android应用程序的插件,是由红色文件夹制作的插件!我知道它只列出了最高的phonegap 3.1.0和我运行的phonegap版本是3.3.0,这可能是问题吗?或者这是默认的Android应用程序行为?

欢迎大家帮助。

格伦。

2 个答案:

答案 0 :(得分:4)

你必须修改文件平台/ android / AndroidManifest.xml,找到<activity>标签,然后设置参数

android:launchMode"singleTop""singleTask"

答案 1 :(得分:1)

设置首选项&#39; AndroidLaunchMode&#39;在您的config.xml中//Game that calculates the highest score based on array inputs #include <stdio.h> #define MAX_PLAYERS 13 #define TRIPLE 3 int main(void) { int nPlayers, i, j, k; int gameNumbers[MAX_PLAYERS]; int runCount, runCounter, runNumber, runScore; int runScores[MAX_PLAYERS] = {0}; //read in numbers scanf("%d", &nPlayers); i = 0; while (i < nPlayers) { scanf("%d", &gameNumbers[i]); i = i + 1; } //Calculates Run Scores //A run is when there are duplicates of the same number in a row runCounter=0; runNumber=0; runScore=0; j=0; for (i=(nPlayers-1); i>=1; i--) { if(gameNumbers[i] - gameNumbers[i-1] == 0) { //compares highest number to previous number to find equality runScores[j]=gameNumbers[i]; j++; runCounter++; runCount=(runCounter+1); runNumber=(gameNumbers[i]); runScore=(runCount*runNumber); } } //Run Score printf("runCounter:%d, runCount=%d, runNumber=%d, runScore=%d\n", runCounter, runCount, runNumber, runScore); printf("runScores[]="); i=0; while (i<runCount) { printf("%d ", runScores[i]); i++; } printf("\n"); //Print run scores printf("Run {%d", runNumber); j=0; while (j < runCounter) { printf(",%d", runScores[j]); //loop prints remainder of the stored run scores array j++; } printf("} scoring %d.\n", runScore); return 0; } singleTop

singleTask

来源: https://cordova.apache.org/docs/en/latest/config_ref/index.html#preference