Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4E6C172D6 for ; Wed, 8 Apr 2015 22:05:12 +0000 (UTC) Received: (qmail 97759 invoked by uid 500); 8 Apr 2015 22:05:12 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 97737 invoked by uid 500); 8 Apr 2015 22:05:12 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 97718 invoked by uid 99); 8 Apr 2015 22:05:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 22:05:12 +0000 Date: Wed, 8 Apr 2015 22:05:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-8684?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1448616= 4#comment-14486164 ]=20 ASF GitHub Bot commented on CB-8684: ------------------------------------ Github user tony-- commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/173#discussion_r28018642 =20 --- Diff: test/androidTest/src/org/apache/cordova/test/CordovaPluginTes= t.java --- @@ -0,0 +1,126 @@ + +package org.apache.cordova.test; + +/* --- End diff -- =20 Whoops! I used one of the other tests as a template - the package is a= bove the copyright in all of them. I'll move it regardless. > support onStart/onStop lifecycle events in plugins for Android > -------------------------------------------------------------- > > Key: CB-8684 > URL: https://issues.apache.org/jira/browse/CB-8684 > Project: Apache Cordova > Issue Type: Improvement > Components: Android > Reporter: Tony Homer > Assignee: Tony Homer > > Enable plugins to handle onStart/onStop lifecycle events in Android imple= mentation. Currently plugin authors that need this feature instruct their = users to modify the CordovaActivity in their project in order to support th= ese lifecycle events. > For example, the Flurry plugin instructions direct users to override > onStart and onStop in their activity in order to handle onStop: > https://github.com/Initsogar/cordova-flurry > There are other analytics plugins that want to know about onStart/onStop > instead of onPause/onResume. > This change will enable native Android support only - there will be no co= rresponding Cordova lifecycle events generated because these events are pla= tform specific. =20 > In addition to the Android platform change, a "quirk"-type notation shoul= d be added to the Android Plugin Development guide, along with possible upd= ate to the example code provided there. > For reference, here is the conversation from the dev mailing list between= [~agrieve] and [~tony--]: > {quote} > On 3/9/15, 12:05 PM, "Andrew Grieve" wrote: > >I see no reason we couldn't add onStart / onStop. > > > >As an aside, if you're okay with supporting only ICS+, you can use > >Application.registerActivityLifecycleCallbacks() as a work-around. > > > > > >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony > wrote: > > > >> I assumed that this must have been discussed at some point, but I > >>couldn=C2=B9t > >> find anything in the list archives or JIRA. > >> I=C2=B9m guessing that there might be some practical issues with > >>onStart/onStop > >> and plugin loading timing, but it seems like if there are issues like > >>this > >> they could be addressed somehow. > >> > >> I=C2=B9m asking about this because we have an internal request to enab= le apps > >> to override onStart/onStop in the Intel XDK build system in order to > >> support plugins that want to handle onStart/onStop. > >> My initial response was =C2=B3why not use onResume/onPause=C2=B2, but = some plugin > >> authors apparently believe that onStart/onStop are the lifecycle event= s > >> they need. > >> > >> For example, the Flurry plugin instructions direct users to override > >> onStart and onStop in their activity in order to handle onStop: > >> https://github.com/Initsogar/cordova-flurry > >> There are other analytics plugins that want to know about onStart/onSt= op > >> instead of onPause/onResume. > >> Obviously it is possible to modify your activity in order to do this i= n > >> your project, but if this capability is important, it should be possib= le > >> without abandoning the Cordova Way. > >> > >> So I was wondering what you guys think? > >> onPause/onResume should be good enough for anyone? > >> onStart/onStop are edge cases that users need to handle by modifying > >>their > >> activity? > >> onStart/onStop cannot be handled by plugins due to timing issues? > >> > >> Thanks! > >> Tony > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org