Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26638

Android: Root Ti.Android.Activity "intent" property should be updated when "newintent" event is fired

    Details

    • Story Points:
      5
    • Sprint:
      2018 Sprint 25, 2018 Sprint 26, 2019 Sprint 1

      Description

      Summary:
      Currently, the root Ti.Android.Activity object's "intent" property never changes when a "newintent" event gets fired. The activity's "intent" property returns the intent that originally launched/created the activity.

      We can improve the usability of the app's "newintent" and intent-filter handling if the root activity's "intent" property was updated to the same intent provided by the "newintent" event.

      Note that Ti.App.Android provides a launchIntent property which already provides the intent used to launch/create the root activity. So, we're not losing anything by making this change.

      Also, it's currently possible to miss the "newintent" event on app startup, before the "app.js" has a chance to set up a listener for it.

      var rootActivity = Ti.Android.currentActivity;
      rootActivity.addEventListener("newintent", function(e) {
      	// Ideally, the 2 intents logged below should be the same.
      	Ti.API.info("### event.intent: " + JSON.stringify(e.intent));
      	Ti.API.info("### rootActivity.intent: " + JSON.stringify(rootActivity.intent));
       
      	// The launch intent property must never change.
      	Ti.API.info("### launchIntent: " + JSON.stringify(Ti.App.Android.launchIntent));
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code