- Name the custom manifest file
AndroidManifest.xml, and put it in the directory
platform/androidbeneath your application's root project directory.
Create the platform directory if you need to, ensuring that the directory is a sibling of the "Resources" directory, (right below your project root).
- If you do have a custom manifest, generates a file named
build/androiddirectory during each build. You can use this to see the
AndroidManifest.xmlthat would be generated by default.
Ensuring Android Shuts Down Apps Cleanly
The are times when an application needs to be shut down by the platform outside of the application context, such as when the user changes fundamental system settings or lets the app sleep for long periods. Unfortunately, Android's primitive kill process sometimes leads to a known problem where the app is only partially shut down. The solution for Titanium apps is to set the
alwaysRetainTaskState parameter in the
AndroidManifest.xml file, as follows (this one is taken from the KitchenSink):
<activity android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:alwaysRetainTaskState="true" android:theme="@style/Theme.Titanium"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity>
Be aware that this setting increases memory usage, so only enable it where your app is experiencing the problem.