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

Android: Allow activity "android:launchMode" attribute to be set in "tiapp.xml"

    Details

    • Story Points:
      1
    • Sprint:
      2018 Sprint 16 SDK

      Description

      Summary:
      In Titanium 6.1.0, our build tools ignore the activity "android:launchMode" setting in "tiapp.xml" and log the following build warning. This was to avoid confusion over how Google's "singleTask" feature works and to favor Titanium's "intent-filter-new-task" property instead.

      [WARN] : android:launchMode should not be used. Ignoring definition from <ActivityName>
      

      We should change the behavior to allow developers to set "android:launchMode" again, but keep the build warning. Some developers already know how to deal with the repercussions of the "singleTask" setting where all child activity windows are automatically closed upon app resume.

      Test:

      1. Add the below Android xml settings to your "tiapp.xml" file.
      2. In the XML, change the <activity> element's "name" attribute's <ProjectName> part to the name of your Titanium project where only the 1st letter is capitalized. (Ex: "MyProject" would become "Myproject".)
      3. Build the application for Android.
      4. Note the build warning that appears regarding "android:launchMode".

      tiapp.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <ti:app xmlns:ti="http://ti.appcelerator.org">
      	<android xmlns:android="http://schemas.android.com/apk/res/android">
      		<manifest>
      			<application>
      				<activity android:name=".<ProjectName>Activity" android:launchMode="singleTask">
      					<intent-filter>
      						<action android:name="android.intent.action.MAIN"/>
      						<category android:name="android.intent.category.LAUNCHER"/>
      					</intent-filter>
      				</activity>
      			</application>
      		</manifest>
      	</android>
      </ti:app>
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              2 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