Added: cordova/site/public/docs/en/dev/guide/platforms/android/lifecycle.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/guide/platforms/android/lifecycle.html?rev=1718507&view=auto
==============================================================================
--- cordova/site/public/docs/en/dev/guide/platforms/android/lifecycle.html 
(added)
+++ cordova/site/public/docs/en/dev/guide/platforms/android/lifecycle.html Tue 
Dec  8 04:08:48 2015
@@ -0,0 +1,1805 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="format-detection" content="telephone=no">
+    <meta name="viewport" content="user-scalable=no, initial-scale=1, 
maximum-scale=1, minimum-scale=1, width=device-width" />
+    <meta name="description" content=" ">
+
+    <title>
+        
+            
+                Android Lifecycle Guide - Apache Cordova
+            
+        
+    </title>
+
+    <link rel="SHORTCUT ICON" href="/favicon.ico"/>
+    <link rel="canonical" 
href="https://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html";>
+
+    <!-- CSS -->
+    <link rel="stylesheet" type="text/css" href="/static/css/main.css">
+
+    
+    <link rel="stylesheet" type="text/css" 
href="/static/js/lib/prettify/prettify.css">
+    
+
+    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media 
queries -->
+    <!--[if lt IE 9]>
+        <script 
src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js";></script>
+        <script 
src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js";></script>
+    <![endif]-->
+    <script type="text/javascript">
+        var disqus_developer = 1; // this would set it to developer mode
+    </script>
+
+    <!-- JS -->
+    <script defer type="text/javascript" 
src="/static/js/lib/jquery-2.1.1.min.js"></script>
+    <script defer type="text/javascript" 
src="/static/js/lib/bootstrap.min.js"></script>
+    <script defer type="text/javascript" 
src="/static/js/lib/ZeroClipboard.js"></script>
+</head>
+
+<body>
+    <a class="scroll-point pt-top" name="top"></a>
+<nav class="navbar navbar-inverse navbar-fixed-top">
+    <div class="container-fluid">
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle collapsed" 
data-toggle="collapse" data-target="#navbar" aria-expanded="false" 
aria-controls="navbar">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="/"><img id="logo_top" 
src="/static/img/cordova-logo-newbrand.svg"/></a>
+        </div>
+        <div id="navbar" class="navbar-collapse collapse">
+            <!-- <img class="pull-right hidden-xs" style="width:25px" 
src="/static/img/search_icon.svg"/> -->
+            <div class="nav_bar_center">
+                <ul class="nav navbar-nav">
+                    <li class="active">
+                        <a 
href="/docs/en/latest/guide/overview/">Documentation</a>
+                    </li>
+                    <li >
+                        <a href="/plugins">Plugins</a>
+                    </li>
+                    <li >
+                        <a href="/blog" id="blog_button">Blog<span 
class="badge" id="new_blog_count"></span></a>
+                    </li>
+                    <li >
+                        <a href="/contribute">Contribute</a>
+                    </li>
+                    <li>
+                        <a href="/#getstarted">Get Started</a>
+                    </li>
+                    <!-- <li class="visible-xs">
+                        <img class="" style="width:25px;margin-left:13px" 
src="/static/img/search_icon.svg"/>
+                    </li> -->
+                </ul>
+            </div>
+        </div><!--/.navbar-collapse -->
+    </div>
+</nav>
+<div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
+
+    <!-- Use the manual ToC, and if it doesn't exist, use the generated one -->
+
+
+    
+
+
+
+
+
+
+
+
+<div class="docs container">
+
+    <!-- Table of Contents -->
+    <div class="hidden-xs hidden-sm col-md-3 site-toc-container">
+        <h2 class="site-toc-title">Table of Contents</h2>
+        <ul class="site-toc">
+            
+            <li>
+                <a class="" href="../../../">
+                    Guides
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/overview/index.html">
+                    Overview
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/support/index.html">
+                    Platform Support
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/cli/index.html">
+                    The Command-Line Interface
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/platforms/index.html">
+                    Platform Guides
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../plugin_ref/plugman.html">
+                    Using Plugman to Manage Plugins
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../config_ref/index.html">
+                    The config.xml File
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../config_ref/images.html">
+                    Icons and Splash Screens
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/hybrid/webviews/index.html">
+                    Embedding WebViews
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/hybrid/plugins/index.html">
+                    Plugin Development Guide
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../plugin_ref/spec.html">
+                    Plugin Specification
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/appdev/privacy/index.html">
+                    Privacy Guide
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/appdev/security/index.html">
+                    Security Guide
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" 
href="../../../platform_plugin_versioning_ref/index.html">
+                    Platforms and Plugins Version Management
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/appdev/whitelist/index.html">
+                    Whitelist Guide
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../cordova/storage/storage.html">
+                    Storage
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/appdev/hooks/index.html">
+                    Hooks Guide
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../guide/next/index.html">
+                    Next Steps
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../cordova/events/events.html">
+                    Events
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../cordova/plugins/pluginapis.html">
+                    Plugin APIs
+                </a>
+                
+            </li>
+            
+            <li>
+                <a class="" href="../../../page_index.html">
+                    Keyword Index
+                </a>
+                
+            </li>
+            
+        </ul>
+    </div>
+
+    <!-- Page content -->
+    <div class="col-md-8 col-md-offset-1">
+
+        <!-- ToC Dropdown (for XS and SM sizes only) -->
+        <div class="toc-dropdown content-header visible-xs-block 
visible-sm-block">
+            <div class="dropdown">
+                <button class="btn btn-default dropdown-toggle" type="button" 
id="tocDropdown" data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="true">
+                    Table of Contents
+                    <span class="caret"></span>
+                </button>
+                <ul class="dropdown-menu">
+                    
+                    <li>
+                        <a class="" href="../../../">
+                            
+                                Guides
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != /docs/en/dev/ -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../guide/overview/index.html">
+                            
+                                Overview
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/overview/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../guide/support/index.html">
+                            
+                                Platform Support
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/support/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../guide/cli/index.html">
+                            
+                                The Command-Line Interface
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/cli/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../guide/platforms/index.html">
+                            
+                                Platform Guides
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/platforms/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../plugin_ref/plugman.html">
+                            
+                                Using Plugman to Manage Plugins
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/plugin_ref/plugman.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../config_ref/index.html">
+                            
+                                The config.xml File
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/config_ref/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../config_ref/images.html">
+                            
+                                Icons and Splash Screens
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/config_ref/images.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/hybrid/webviews/index.html">
+                            
+                                Embedding WebViews
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/hybrid/webviews/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/hybrid/plugins/index.html">
+                            
+                                Plugin Development Guide
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/hybrid/plugins/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../plugin_ref/spec.html">
+                            
+                                Plugin Specification
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/plugin_ref/spec.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/appdev/privacy/index.html">
+                            
+                                Privacy Guide
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/appdev/privacy/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/appdev/security/index.html">
+                            
+                                Security Guide
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/appdev/security/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../platform_plugin_versioning_ref/index.html">
+                            
+                                Platforms and Plugins Version Management
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/platform_plugin_versioning_ref/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/appdev/whitelist/index.html">
+                            
+                                Whitelist Guide
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/appdev/whitelist/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../cordova/storage/storage.html">
+                            
+                                Storage
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/cordova/storage/storage.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../guide/appdev/hooks/index.html">
+                            
+                                Hooks Guide
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/appdev/hooks/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../guide/next/index.html">
+                            
+                                Next Steps
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/guide/next/index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../cordova/events/events.html">
+                            
+                                Events
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/cordova/events/events.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" 
href="../../../cordova/plugins/pluginapis.html">
+                            
+                                Plugin APIs
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/cordova/plugins/pluginapis.html -->
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        <a class="" href="../../../page_index.html">
+                            
+                                Keyword Index
+                                <!-- DEBUG: 
/docs/en/dev/guide/platforms/android/lifecycle.html != 
/docs/en/dev/page_index.html -->
+                            
+                        </a>
+                    </li>
+                    
+                </ul>
+            </div>
+        </div>
+
+        <div class="content-header">
+
+            <a class="edit" 
href="https://github.com/apache/cordova-docs/tree/master/www/docs/en/dev/guide/platforms/android/lifecycle.md";>
+                <span class="glyphicon glyphicon-pencil" 
aria-hidden="true"></span> Edit
+            </a>
+
+            <!-- Language dropdown -->
+            <div class="dropdown">
+                <button class="btn btn-default dropdown-toggle" type="button" 
id="languageDropdown" data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="true">
+                    English
+                    <span class="caret"></span>
+                </button>
+
+                <!-- List all languages -->
+                <ul class="dropdown-menu" aria-labelledby="languageDropdown">
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/de/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Deutsch
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/en/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                <span class="selected">
+                                    English
+                                </span>
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/es/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Español
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/fr/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Français
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/it/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Italiano
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/ja/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                日本語
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/ko/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                한국어
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/pl/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Polski
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/ru/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Русский
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/sl/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                Slovene
+                            
+                        </a>
+                    </li>
+                    
+
+                    
+                    
+
+                    
+                    
+
+                    <!--
+                    Replace only the language part of the URI, thereby
+                    redirecting to the same page in the other language.
+                    The page should exist because it's for the same version.
+                     -->
+                    
+
+                    
+
+                    <li>
+                        <a 
href="/docs/zh/dev/guide/platforms/android/lifecycle.html" class="
+                        
+                        
+                    "
+                        >
+                            
+                                汉语
+                            
+                        </a>
+                    </li>
+                    
+                </ul>
+            </div>
+
+            <!-- Version dropdown -->
+            <div class="dropdown">
+                <button class="btn btn-default dropdown-toggle" type="button" 
id="versionDropdown" data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="true">
+                    dev
+                    
+                    <span class="caret"></span>
+                </button>
+                <ul class="dropdown-menu" aria-labelledby="versionDropdown">
+
+                    <!-- List versions available in this language -->
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/dev/guide/platforms/android/lifecycle.html">
+                            
+                                <span class="selected">
+                                    
+                            dev
+                            
+                        
+                                </span>
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/5.4.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            5.4.0
+                            
+                                (Latest)
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/5.1.1/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            5.1.1
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/5.0.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            5.0.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/4.0.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            4.0.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.6.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.6.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.5.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.5.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.4.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.4.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.3.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.3.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.2.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.2.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.1.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.1.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/3.0.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            3.0.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.9.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.9.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.8.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.8.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.7.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.7.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.6.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.6.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.5.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.5.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.4.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.4.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.3.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.3.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.2.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.2.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.1.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.1.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/2.0.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            2.0.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.9.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.9.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.8.1/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.8.1
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.8.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.8.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.7.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.7.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.6.1/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.6.1
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.6.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.6.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                    <li>
+                        
+                        
+
+                        
+
+                        <!--
+                        Replace only the version part of the URI, thereby
+                        redirecting to the same page in the other version.
+
+                        WARNING:
+                            this page might not exist in the target version
+                            because page layouts change from version to version
+                         -->
+                        
+
+                        <a 
href="/docs/en/1.5.0/guide/platforms/android/lifecycle.html">
+                            
+                                
+                            1.5.0
+                            
+                        
+                            
+                        </a>
+                    </li>
+                    
+                </ul>
+            </div>
+        </div>
+
+        <!-- Get URL for this page in the latest version -->
+        
+        
+        
+
+        <!-- Show warnings for special versions (i.e. non-latest, and dev) -->
+        
+
+            
+                
+                
+            
+
+            <div class="alert alert-info docs-alert" role="alert">
+                <button type="button" class="close" data-dismiss="alert" 
aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+                This version of the documentation is under development!
+                <a 
href="/docs/en/latest/guide/platforms/android/lifecycle.html">
+                    Click here for the latest released version
+                </a>
+            </div>
+
+        
+
+        <div id="page-toc-source">
+            <h1>Android Lifecycle Guide</h1>
+
+<p>Native Android apps typically consist of a series of &quot;activities&quot; 
that the user interacts with. Activities can be thought of as the individual 
screens that make up an application; different tasks in an app will often have 
their own activity. Each activity has a lifecycle, and can be created and 
destroyed as the OS sees fit.</p>
+
+<p>In contrast, Cordova applications on the Android platform are executed 
within a Webview that is embedded in a <em>single</em> Android activity. The 
lifecycle of this activity is exposed to your application through the document 
events that are fired. These events are not guaranteed to line up with 
Android&#39;s lifecycle, but they can provide guidelines for saving and 
restoring your state. These events roughly map to Android callbacks as 
follows:</p>
+
+<table><thead>
+<tr>
+<th>Cordova Event</th>
+<th>Rough Android Equivalent</th>
+</tr>
+</thead><tbody>
+<tr>
+<td><code class="prettyprint">deviceready</code></td>
+<td><code class="prettyprint">onCreate()</code></td>
+</tr>
+<tr>
+<td><code class="prettyprint">pause</code></td>
+<td><code class="prettyprint">onPause()</code></td>
+</tr>
+<tr>
+<td><code class="prettyprint">resume</code></td>
+<td><code class="prettyprint">onResume()</code></td>
+</tr>
+</tbody></table>
+
+<p>Often, Cordova applications are confined to the single activity that 
contains the Webview. However, there are instances in which other activities 
may be launched that push the Cordova activity to the background. It is 
important in these cases to be aware of the Android lifecycle and properly 
maintain your application&#39;s state by respecting it.</p>
+
+<h2>Low memory and the Activity lifecycle</h2>
+
+<p>Plugins have the ability to launch activities beyond the Cordova activity 
in order to perform some tasks. For example, the Apache camera plugin, 
cordova-plugin-camera, launches the device&#39;s camera activity in order to 
take photos.</p>
+
+<p>The flow of events in this case looks something like this:</p>
+
+<ol>
+<li>The user is interacting with your app and needs to take a picture</li>
+<li>The camera plugin launches the native camera activity
+
+<ul>
+<li><em>The Cordova activity is pushed to the background (<code 
class="prettyprint">pause</code> event is fired)</em></li>
+</ul></li>
+<li>The user takes a photo</li>
+<li>The camera activity finishes
+
+<ul>
+<li><em>The Cordova activity is moved to the foreground (<code 
class="prettyprint">resume</code> event is fired)</em></li>
+</ul></li>
+<li>The user is returned to your application where they left off</li>
+</ol>
+
+<p>However, this flow of events can be disrupted if a device is low on memory. 
The Android OS will often kill background activities in order to free up memory 
if necessary. Unfortunately, when the activity holding your application is 
killed, the Webview in which your application lives will be destroyed as well. 
Any state that your application is maintaining will be lost in this case. When 
the user navigates back to your the application, the Activity and Webview will 
be recreated by the OS, but state will not be automatically restored.</p>
+
+<p>If state is not properly saved when the Activity is destroyed, the above 
sequence of events instead plays out as follows:</p>
+
+<ol>
+<li>The user is interacting with your app and needs to take a picture</li>
+<li>The camera plugin launches the native camera activity
+
+<ul>
+<li><em>The OS destroys the Cordova activity (<code 
class="prettyprint">pause</code> event is fired)</em></li>
+</ul></li>
+<li>The user takes a photo</li>
+<li>The camera activity finishes
+
+<ul>
+<li><em>The OS recreates the Cordova activity (<code 
class="prettyprint">deviceready</code> and <code 
class="prettyprint">resume</code> events are fired)</em></li>
+</ul></li>
+<li>The user is confused as to why they are suddenly back at your app&#39;s 
login screen</li>
+</ol>
+
+<p>In this instance, the photo that was taken is lost and the user is given 
the confusing and frustrating experience of having your application appear to 
randomly restart. The key to preventing this experience is subscribing to 
events and properly maintaining state as part of the activity lifecycle.</p>
+
+<h2>Maintaining state</h2>
+
+<p>In the examples above, the javascript events that are fired are noted in 
italics. These events are your opportunity to save and restore your 
application&#39;s state. You should register callbacks in your 
application&#39;s <code class="prettyprint">bindEvents</code> function that 
respond to the lifecycle events by saving state. What information you save and 
how you save it is left to your discretion, but you should be sure to save 
enough information so that you can restore the user to exactly where they left 
off when they return to your application.</p>
+
+<h2>Testing the Activity Lifecycle</h2>
+
+<p>Android provides a developer setting for debugging Activity destruction on 
low memory. Enable the &quot;Don&#39;t keep activities&quot; setting in the 
Developer Options menu on your device or emulator to simulate low memory 
scenarios. If your application launches external activities, you should always 
do some testing with this setting enabled to ensure that you are properly 
handling low memory scenarios.</p>
+
+<h2>Retrieving plugin callback results</h2>
+
+<p>When the OS destroys the Cordova activity in the above example, any pending 
callbacks are lost as well. This means that if you passed a callback to the 
plugin that launched the new activity (e.g. cordova-plugin-camera), that 
callback will NOT be fired when the application is recreated. However, there is 
a way for plugins to pass the result of this call to your application. The 
<code class="prettyprint">resume</code> event&#39;s payload will contain any 
pending plugin results from the plugin request that launched the external 
activity made prior to the activity being destroyed.</p>
+
+<p>The payload for the <code class="prettyprint">resume</code> event adheres 
to the following format:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">{
+    action: &quot;resume&quot;,
+    pendingResult: {
+        pluginServiceName: &lt;name of the plugin e.g. &quot;Camera&quot;&gt;,
+        pluginStatus: &lt;description of the result&#39;s status (see 
below)&gt;,
+        result: &lt;argument(s) that would have been given to the callback&gt;
+    }
+}
+</code></pre></div>
+<p>The possible plugin statuses in the <code 
class="prettyprint">pendingResult</code> field include the following values:</p>
+<div class="highlight"><pre><code class="language-text" 
data-lang="text">&quot;No result&quot;
+&quot;OK&quot;
+&quot;Class not found&quot;
+&quot;Illegal access&quot;
+&quot;Instantiation error&quot;
+&quot;Malformed url&quot;
+&quot;IO error&quot;
+&quot;Invalid action&quot;
+&quot;JSON error&quot;
+&quot;Error
+</code></pre></div>
+<blockquote>
+<p><strong>NOTE:</strong> It is up to the plugin to decide what is contained 
in the <code class="prettyprint">result</code> field and the meaning of the 
<code class="prettyprint">pluginStatus</code> that is returned. Reference the 
API of the plugin you are using to see what you should expect those fields to 
contain and how to use their values</p>
+</blockquote>
+
+<p>A <code class="prettyprint">resume</code> callback that makes use of the 
event payload might look something like this:</p>
+<div class="highlight"><pre><code class="language-javascript" 
data-lang="javascript"><span class="nx">onResume</span><span 
class="p">(</span><span class="nx">event</span><span class="p">)</span> <span 
class="p">{</span>
+    <span class="c1">// Restore your application&#39;s state here. It&#39;s up 
to you to keep track of</span>
+    <span class="c1">// where this plugin result is coming from (i.e. what 
part of your code made</span>
+    <span class="c1">// the call) and what arguments you provided to the 
plugin</span>
+
+    <span class="c1">// Next, check if there is a plugin result in the event 
object</span>
+    <span class="k">if</span><span class="p">(</span><span 
class="nx">event</span><span class="p">.</span><span 
class="nx">pendingResult</span><span class="p">)</span> <span class="p">{</span>
+        <span class="c1">// Figure out whether or not the plugin call was 
successful</span>
+        <span class="k">if</span><span class="p">(</span><span 
class="nx">event</span><span class="p">.</span><span 
class="nx">pendingResult</span><span class="p">.</span><span 
class="nx">pluginStatus</span> <span class="o">===</span> <span 
class="s2">&quot;OK&quot;</span><span class="p">)</span> <span 
class="p">{</span>
+            <span class="nx">successCallback</span><span 
class="p">(</span><span class="nx">event</span><span class="p">.</span><span 
class="nx">result</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span 
class="p">{</span>
+            <span class="nx">failCallback</span><span class="p">(</span><span 
class="nx">event</span><span class="p">.</span><span 
class="nx">result</span><span class="p">);</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</code></pre></div>
+
+        </div>
+    </div>
+</div>
+
+<script defer type="text/javascript" src="/static/js/lib/toc.min.js"></script>
+<script defer type="text/javascript" src="/static/js/docs.js"></script>
+
+    <div class="blue-divider"></div>
+<footer>
+    <div class="container" id="footer">
+        <div class="row">
+            <div class="col-sm-9">
+                <h1>More Resources</h1>
+                <div class="row">
+                    <div class="col-sm-4">
+                        <h2>General</h2>
+                        <ul class="nav">
+                            <li>
+                                <a target="_blank" 
href="https://projects.apache.org/project.html?cordova";>Apache Project Page</a>
+                            </li>
+                            <li>
+                                <a target="_blank" 
href="http://www.apache.org/licenses/LICENSE-2.0";>License</a>
+                            </li>
+                            <li>
+                                <a href="/artwork">Artwork</a>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="col-sm-4">
+                        <h2>Development</h2>
+                        <ul class="nav">
+                            <li><a target="_blank" 
href="https://github.com/apache?utf8=%E2%9C%93&amp;query=cordova-";>Source 
Code</a></li>
+                            <li><a target="_blank" 
href="https://issues.apache.org/jira/browse/CB/";>Issue Tracker</a></li>
+                            <li><a target="_blank" 
href="http://stackoverflow.com/questions/tagged/cordova";>Stack Overflow</a></li>
+                            <li><a href="/contact">Mailing List</a></li>
+                        </ul>
+                    </div>
+                    <div class="col-sm-4">
+                        <h2>Apache Software Foundation</h2>
+                        <ul class="nav">
+                            <li>
+                                <a target="_blank" 
href="http://www.apache.org/";>About ASF</a>
+                            </li>
+                            <li>
+                                <a target="_blank" 
href="http://www.apache.org/foundation/sponsorship.html";>Become a Sponsor</a>
+                            </li>
+                            <li>
+                                <a target="_blank" 
href="http://www.apache.org/foundation/thanks.html";>Thanks</a>
+                            </li>
+                            <li>
+                                <a target="_blank" 
href="http://www.apache.org/security/";>Security</a>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+            <div class="col-sm-3">
+                <h1>Contribute</h1>
+                <p style="padding-top:20px"><strong>Help Cordova move 
forward!</strong></p>
+                <p>Report bugs, improve the docs, or contribute to the 
code.</p>
+                <a href="/contribute" class="btn btn-lg btn-primary">
+                    Learn More
+                </a>
+                <p style="padding-top:20px"> <a 
href="https://twitter.com/apachecordova"; class="twitter-follow-button" 
data-show-count="false">Follow @apachecordova</a></p>
+                <script async defer 
src="https://slack.cordova.io/slackin.js";></script>
+            </div>
+        </div>
+        <p class="copyright_text">
+            Copyright &copy; 2012, 2013, 2015 The Apache Software Foundation, 
Licensed under the <a target="_blank" 
href="http://www.apache.org/licenses/LICENSE-2.0";>Apache License, Version 
2.0</a>.<br/>
+            Apache and the Apache feather logos are <a target="_blank" 
href="http://www.apache.org/foundation/marks/list/";>trademarks</a> of The 
Apache Software Foundation.
+        </p>
+        <a class="closing" href="#top"></a>
+    </div>
+</footer>
+
+<script defer type="text/javascript" 
src="/static/js/lib/prettify/prettify.js"></script>
+<script defer type="text/javascript" src="/static/js/index.js"></script>
+<script defer type="text/javascript" src="/static/js/twitter.js"></script>
+
+    <script>
+    
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
+    
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+    
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+    ga('create', 'UA-64283057-3', 'auto');
+    ga('send', 'pageview');
+</script>
+
+</body>
+</html>

Modified: cordova/site/public/docs/en/dev/guide/platforms/android/plugin.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/guide/platforms/android/plugin.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/guide/platforms/android/plugin.html 
(original)
+++ cordova/site/public/docs/en/dev/guide/platforms/android/plugin.html Tue Dec 
 8 04:08:48 2015
@@ -1893,16 +1893,124 @@ every plugin should override.  An exampl
 <p>Then when requesting the permission, all that needs to be done is the 
following:</p>
 <div class="highlight"><pre><code class="language-text" 
data-lang="text">cordova.requestPermissions(this, 0, permissions);
 </code></pre></div>
-<p>This requests the permissions specified in the array.  It&#39;s a good idea 
to provide a publicly accessible permissions array since this can be used by 
plugins that use your plugin as a 
+<p>This requests the permissions specified in the array.  It&#39;s a good idea 
to provide a publicly accessible permissions array since this can be used by 
plugins that use your plugin as a
 dependency, although this is not required.</p>
 
 <h2>Debugging Android Plugins</h2>
 
 <p>Android debugging can be done with either Eclipse or Android Studio, 
although Android
 studio is recommended.  Since Cordova-Android is currently used as a library 
project,
-and plugins are supported as source code, it is possible to debug the Java 
code inside 
+and plugins are supported as source code, it is possible to debug the Java 
code inside
 a Cordova application just like a native Android application.</p>
 
+<h2>Launching Other Activities</h2>
+
+<p>There are special considerations to be made if your plugin launches an 
Activity
+that pushes the Cordova Activity to the background. The Android OS will destroy
+Activities in the background if the device is running low on memory. In that
+case, the CordovaPlugin instance will be destroyed as well. If your plugin is
+waiting on a result from the Activity it launched, a new instance of your 
plugin
+will be created when the Cordova Activity is brought back to the foreground and
+the result is obtained. However, state for the plugin will not be automatically
+saved or restored and the CallbackContext for the plugin will be lost. There 
are
+two methods that your CordovaPlugin may implement to handle this situation:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span 
class="cm">/**</span>
+<span class="cm"> * Called when the Activity is being destroyed (e.g. if a 
plugin calls out to an</span>
+<span class="cm"> * external Activity and the OS kills the CordovaActivity in 
the background).</span>
+<span class="cm"> * The plugin should save its state in this method only if it 
is awaiting the</span>
+<span class="cm"> * result of an external Activity and needs to preserve some 
information so as</span>
+<span class="cm"> * to handle that result; onRestoreStateForActivityResult() 
will only be called</span>
+<span class="cm"> * if the plugin is the recipient of an Activity result</span>
+<span class="cm"> *</span>
+<span class="cm"> * @return  Bundle containing the state of the plugin or null 
if state does not</span>
+<span class="cm"> *          need to be saved</span>
+<span class="cm"> */</span>
+<span class="kd">public</span> <span class="n">Bundle</span> <span 
class="nf">onSaveInstanceState</span><span class="o">()</span> <span 
class="o">{}</span>
+
+<span class="cm">/**</span>
+<span class="cm"> * Called when a plugin is the recipient of an Activity 
result after the</span>
+<span class="cm"> * CordovaActivity has been destroyed. The Bundle will be the 
same as the one</span>
+<span class="cm"> * the plugin returned in onSaveInstanceState()</span>
+<span class="cm"> *</span>
+<span class="cm"> * @param state             Bundle containing the state of 
the plugin</span>
+<span class="cm"> * @param callbackContext   Replacement Context to return the 
plugin result to</span>
+<span class="cm"> */</span>
+<span class="kd">public</span> <span class="kt">void</span> <span 
class="nf">onRestoreStateForActivityResult</span><span class="o">(</span><span 
class="n">Bundle</span> <span class="n">state</span><span class="o">,</span> 
<span class="n">CallbackContext</span> <span 
class="n">callbackContext</span><span class="o">)</span> <span 
class="o">{}</span>
+</code></pre></div>
+<p>It is important to note that the above methods should only be used if your
+plugin launches an Activity for a result and should only restore the state
+necessary to handle that Activity result. The state of the plugin will 
<em>NOT</em> be
+restored except in the case where an Activity result is obtained that your
+plugin requested using the CordovaInterface&#39;s <code 
class="prettyprint">startActivityForResult()</code> method
+and the Cordova Activity was destroyed by the OS while in the background.</p>
+
+<p>As part of <code 
class="prettyprint">onRestoreStateForActivityResult()</code>, your plugin will 
be passed a
+replacement CallbackContext. It is important to realize that this
+CallbackContext <em>IS NOT</em> the same one that was destroyed with the 
Activity. The
+original callback is lost, and will not be fired in the javascript application.
+Instead, this replacement CallbackContext will return the result as part of the
+<code class="prettyprint">resume</code> event that is fired when the 
application resumes. The payload of the
+<code class="prettyprint">resume</code> event follows this structure:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">{
+    action: &quot;resume&quot;,
+    pendingResult: {
+        pluginServiceName: &lt;name of the plugin e.g. &quot;Camera&quot;&gt;,
+        pluginStatus: &lt;description of the result&#39;s status&gt;,
+        result: &lt;argument(s) that would have been given to the callback&gt;
+    }
+}
+</code></pre></div>
+<ul>
+<li><code class="prettyprint">pluginServiceName</code> will match the <code 
class="prettyprint">name</code> attribute from your plugin.xml</li>
+<li><code class="prettyprint">pluginStatus</code> will be a String describing 
the status of the PluginResult
+passed to the CallbackContext. See PluginResult.java for the String values
+that correspond to plugin statuses</li>
+<li><code class="prettyprint">result</code> will be whatever result the plugin 
passes to the CallbackContext
+(e.g. a String, a number, a JSON object, etc.)</li>
+</ul>
+
+<p>This resume payload will be passed to any callbacks that the javascript
+application has registered for the <code class="prettyprint">resume</code> 
event. This means that the result is
+going <em>directly</em> to the Cordova application; your plugin will not have 
a chance
+to process the result with javascript before the application receives it.
+Consequently, you should strive to make the result returned by the native code
+as complete as possible and not rely on any javascript callbacks when launching
+activities.</p>
+
+<p>Be sure to communicate how the Cordova application should interpret the 
result
+they receive in the <code class="prettyprint">resume</code> event. It is up to 
the Cordova application to
+maintain their own state and remember what requests they made and what 
arguments
+they provided if necessary. However, you should still clearly communicate the
+meaning of <code class="prettyprint">pluginStatus</code> values and what sort 
of data is being returned in the
+<code class="prettyprint">result</code> field as part of your plugin&#39;s 
API.</p>
+
+<p>The complete sequence of events for launching an Activity is as follows</p>
+
+<ol>
+<li>The Cordova application makes a call to your plugin</li>
+<li>Your plugin launches an Activity for a result</li>
+<li>The Android OS destroys the Cordova Activity and your plugin instance
+
+<ul>
+<li><em><code class="prettyprint">onSaveInstanceState()</code> is 
called</em></li>
+</ul></li>
+<li>The user interacts with your Activity and the Activity finishes</li>
+<li>The Cordova Activity is recreated and the Activity result is received
+
+<ul>
+<li><em><code class="prettyprint">onRestoreStateForActivityResult()</code> is 
called</em></li>
+</ul></li>
+<li><code class="prettyprint">onActivityResult()</code> is called and your 
plugin passes a result to the new
+CallbackContext</li>
+<li>The <code class="prettyprint">resume</code> event is fired and received by 
the Cordova application</li>
+</ol>
+
+<p>Android provides a developer setting for debugging Activity destruction on 
low
+memory. Enable the &quot;Don&#39;t keep activities&quot; setting in the 
Developer Options menu
+on your device or emulator to simulate low memory scenarios. If your plugin
+launches external activities, you should always do some testing with this
+setting enabled to ensure that you are properly handling low memory 
scenarios.</p>
+
 
         </div>
     </div>

Modified: cordova/site/public/docs/en/dev/guide/platforms/index.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/guide/platforms/index.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/guide/platforms/index.html (original)
+++ cordova/site/public/docs/en/dev/guide/platforms/index.html Tue Dec  8 
04:08:48 2015
@@ -1624,6 +1624,7 @@ a lower-level alternative to the <code c
 <li><a href="android/plugin.html">Android Plugins</a></li>
 <li><a href="android/webview.html">Android WebViews</a></li>
 <li><a href="android/upgrade.html">Upgrading Android</a></li>
+<li><a href="android/lifecycle.html">Android Lifecycle Guide</a></li>
 </ul>
 
 <h2>BlackBerry 10</h2>

Modified: cordova/site/public/docs/en/dev/page_index.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/page_index.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/page_index.html (original)
+++ cordova/site/public/docs/en/dev/page_index.html Tue Dec  8 04:08:48 2015
@@ -1634,6 +1634,14 @@ var keywordIndex = [
     
 
     {
+        url: "/docs/en/dev/guide/platforms/android/lifecycle.html",
+        name: "Android Lifecycle Guide"
+    }
+    
+    ,
+    
+
+    {
         url: "/docs/en/dev/guide/platforms/android/index.html",
         name: "Android Platform Guide"
     }

Modified: cordova/site/public/feed.xml
URL: 
http://svn.apache.org/viewvc/cordova/site/public/feed.xml?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/feed.xml (original)
+++ cordova/site/public/feed.xml Tue Dec  8 04:08:48 2015
@@ -6,8 +6,8 @@
 </description>
     <link>https://cordova.apache.org/</link>
     <atom:link href="https://cordova.apache.org/feed.xml"; rel="self" 
type="application/rss+xml"/>
-    <pubDate>Tue, 24 Nov 2015 22:14:50 -0800</pubDate>
-    <lastBuildDate>Tue, 24 Nov 2015 22:14:50 -0800</lastBuildDate>
+    <pubDate>Mon, 07 Dec 2015 19:20:03 -0800</pubDate>
+    <lastBuildDate>Mon, 07 Dec 2015 19:20:03 -0800</lastBuildDate>
     <generator>Jekyll v2.5.3</generator>
     
       <item>

Modified: cordova/site/public/news/2013/09/06/last-week.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/09/06/last-week.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/09/06/last-week.html (original)
+++ cordova/site/public/news/2013/09/06/last-week.html Tue Dec  8 04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/09/13/last-week.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/09/13/last-week.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/09/13/last-week.html (original)
+++ cordova/site/public/news/2013/09/13/last-week.html Tue Dec  8 04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/10/01/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/10/01/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/10/01/plugins-release.html (original)
+++ cordova/site/public/news/2013/10/01/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/10/10/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/10/10/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/10/10/plugins-release.html (original)
+++ cordova/site/public/news/2013/10/10/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/10/21/cordova-registry.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/10/21/cordova-registry.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/10/21/cordova-registry.html (original)
+++ cordova/site/public/news/2013/10/21/cordova-registry.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/10/28/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/10/28/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/10/28/plugins-release.html (original)
+++ cordova/site/public/news/2013/10/28/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2013/12/04/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2013/12/04/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2013/12/04/plugins-release.html (original)
+++ cordova/site/public/news/2013/12/04/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/01/02/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/01/02/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/01/02/plugins-release.html (original)
+++ cordova/site/public/news/2014/01/02/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/01/31/tools-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/01/31/tools-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/01/31/tools-release.html (original)
+++ cordova/site/public/news/2014/01/31/tools-release.html Tue Dec  8 04:08:48 
2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/02/10/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/02/10/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/02/10/plugins-release.html (original)
+++ cordova/site/public/news/2014/02/10/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/03/03/plugins-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/03/03/plugins-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/03/03/plugins-release.html (original)
+++ cordova/site/public/news/2014/03/03/plugins-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/03/05/tools-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/03/05/tools-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/03/05/tools-release.html (original)
+++ cordova/site/public/news/2014/03/05/tools-release.html Tue Dec  8 04:08:48 
2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog

Modified: cordova/site/public/news/2014/04/09/tools-ios-release.html
URL: 
http://svn.apache.org/viewvc/cordova/site/public/news/2014/04/09/tools-ios-release.html?rev=1718507&r1=1718506&r2=1718507&view=diff
==============================================================================
--- cordova/site/public/news/2014/04/09/tools-ios-release.html (original)
+++ cordova/site/public/news/2014/04/09/tools-ios-release.html Tue Dec  8 
04:08:48 2015
@@ -83,7 +83,7 @@
 </nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
 
-    <div class="container">
+    <div class="page container">
     <div class="blog">
     <h1 class="blogHeader">
     Blog




---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to