[TIMOB-15487] Android: Being able to name the activity related to a heavyweight window
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2014-04-03T19:15:39.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | 2014 Sprint 07, 2014 Sprint 07 SDK |
Components | Android |
Labels | SupportTeam |
Reporter | Mauro Parra-Miranda |
Assignee | Vishal Duggal |
Created | 2013-10-15T02:04:38.000+0000 |
Updated | 2017-03-22T22:53:44.000+0000 |
We think that TiJSActivity is the correct short-term solution. We will revisit this as part of Ti.Next, as it requires breaking changes to the API.
The Current Titanium Windowing system is view centric. Although every heavyweight window creates a new Activity, the activity is one of two classes TiActivity and TiTranslucentActivity. There are two workarounds to this issue. 1. Create a native Android Activity and launch it through proper intents. The drawback of this method of course would be that you would not get a built in JS bridge. 2. Launch activities associated with java script files (Commonly referred to as JSActivity). The usage of the JSActivity is similar to the
url
parameter of the Ti.UI.Window class. Please note that the JSActivity thus created has no specific theme and will inherit the application theme. To determine the exact class name see the generated Android Manifest file in the build folder. To overwrite the default activity setting add corresponding entries to the tiapp.xml for the generated activity. The steps required to create and use a JS activity are as follows. 1. Add an entry to the tiapp.xml to declare the activity. In the android section of tiapp.xml add something similar to the entry below2. Create an intent to launch the activity associated with the JS file. Example below
3. Launch the intent with the top most activity Full code example shown below
Closing ticket as "Won't Fix".