How to resume the application when you click the application launch button in cordova?

I am developing a mobile application with cordova phonegap. I am testing it on the Android platform right now on ios. My problem is that I have an application running in the background, and I press the start button of this application, it is reinitialized. I just want to open the application from the launch icon and continue working from where it is. I tried to set the attribute keepRuningin config.xml true , but it does not work.

   <preference name="keepRunning" value="true" />

This is the config.xml file:

     <?xml version="1.0" encoding="utf-8" standalone="no"?>
     <widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="com.coolappz.HTML5Application1" version="1.0.0">
        <name>HTML5Application1</name>
        <description>Cordova Application</description>
        <author email="info@com.coolappz" href="http://www.coolappz.com">user</author>
        <access origin="*"/>
        <preference name="fullscreen" value="true"/>
        <preference name="webviewbounce" value="true"/>
        <preference name="keepRunning" value="true" />

    </widget>

EDIT: For more information:

, 1 . , home. , , , .

, .

:

cordova .
?

+1
2

,

     android:launchMode="singleInstance"

AndroidManifest.xml, projectName/platform/android/AndroidManifest.xml.

.

0

config.xml .

    <preference name="permissions"                value="none"/>
     <!-- Customize your app and platform with the preference element. -->
    <preference name="phonegap-version"           value="3.3.0" />    <!-- all: current version of PhoneGap -->
    <preference name="orientation"                value="default" />        <!-- all: default means both landscape and portrait are enabled -->
    <preference name="target-device"              value="universal" />      <!-- all: possible values handset, tablet, or universal -->
    <preference name="fullscreen"                 value="true" />           <!-- all: hides the status bar at the top of the screen -->
   <preference name="webviewbounce"              value="false" />           <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
   <preference name="prerendered-icon"           value="true" />           <!-- ios: if icon is prerendered, iOS will not apply it gloss to the app icon on the user home screen -->
   <preference name="stay-in-webview"            value="false" />          <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
   <preference name="ios-statusbarstyle"         value="black-opaque" />   <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
   <preference name="detect-data-types"          value="true" />           <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
   <preference name="exit-on-suspend"            value="false" />          <!-- ios: if set to true, app will terminate when home button is pressed -->
   <preference name="show-splash-screen-spinner" value="true" />           <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
   <preference name="auto-hide-splash-screen"    value="true" />           <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
   <preference name="disable-cursor"             value="false" />          <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
   <preference name="android-minSdkVersion"      value="10" />              <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
   <preference name="android-installLocation"    value="auto" />           <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
   <preference name="KeyboardDisplayRequiresUserAction " value="false"/>
0

Source: https://habr.com/ru/post/1548028/


All Articles