[TIMOB-4261] Android: Support making changes to root <activity> in <manifest> section of tiapp.xml, and having those changes be carried into generated manifest
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-09T08:52:30.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-23, Release 1.7.2, Release 1.8.0 |
Components | Android |
Labels | n/a |
Reporter | Bill Dawson |
Assignee | Eduardo Gomez |
Created | 2011-05-31T13:42:48.000+0000 |
Updated | 2017-03-16T20:53:24.000+0000 |
Description
Example: If I want to add the
android:alwaysRetainTaskState="true"
attribute to the KitchenSink's root activity entry in AndroidManifest.xml, I should be able to put the manifest entry for the KitchenSink root activity (.KitchensinkActivity) into tiapp.xml like below and have it carry into the generated AndroidManifest.xml
<manifest><application>
<activity android:name=".KitchensinkActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation"
android:label="Kitchensink"
android:name=".KitchensinkActivity"
android:theme="@style/Theme.Titanium">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application></manifest>
(Note I put android:alwaysRetainTaskState="true"
in there.) Currently this works already for all activities *except* the root activity, and now we want it to work for the root activity as well.
Pull request done. https://github.com/appcelerator/titanium_mobile/pull/111 To test (with the pull request's changes, of course): * Open KitchenSink's tiapp.xml. * You'll notice that in the android->manifest->application section there is an
<activity>
entry for the KitchenSink's root activity. * Note that thatactivity
entry has theandroid:alwaysRetainTaskState="true"
attribute on it. That is a non-standard attribute that is *not* part of our template AndroidManifest.xml. * Build and run KS. * Look at the generated AndroidManifest.xml (build/android/AndroidManifest.xml) and confirm that theactivity
entry for the root activity (the activity withandroid:name=".KitchensinkActivity
has theandroid:alwaysRetainTaskState="true"
as well.Closing ticket as fixed.