[TIMOB-4643] Application crashes if a custom theme is included in the project
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-05T10:30:57.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2011-31, Release 1.8.0 |
Components | Android |
Labels | platform_android, qe-testadded |
Reporter | Anirudh Nagesh |
Assignee | Eric Merriman |
Created | 2011-07-12T13:30:19.000+0000 |
Updated | 2014-06-19T12:46:19.000+0000 |
Description
Including a custom theme.xml and applying it one of the activities results in a crash of the application. Works fine with Ti SDK 1.7 versions..
Step: Copy the below code in app.js
var win = Titanium.UI.createWindow({ backgroundColor: '#fff', fullscreen: true });
win.add(Ti.UI.createLabel({ text: 'Press your hardware menu button!' }));
win.open();
// keep a pointer to the current activity
var currentActivity = win.activity;
// and make an options menu
currentActivity.onCreateOptionsMenu = function(e) {
e.menu.add({ title: 'Open Dialog' }).addEventListener("click", function() {
var intent = Ti.Android.createIntent({
url: 'temp.js'
});
intent.putExtra('modal', true);
currentActivity.startActivity(intent);
});
};
Step2: Copy the below code to temp.js.
var win = Ti.UI.currentWindow;
win.modal = true;
win.add(Ti.UI.createLabel({
text: 'Hello, world!'
}));
Step3: Create a file 'theme.xml' in root->platform->android->res->values folder. Copy the below code into it.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="FullHeightDialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.Titanium" parent="android:Theme.NoTitleBar.Fullscreen">
<item name="android:windowBackground">@drawable/background</item>
</style>
</resources>
Step4: Run the app with Ti SDK set to 1.8.0. Application crashes.
Attachments
File | Date | Size |
---|---|---|
console.txt | 2011-07-12T13:59:55.000+0000 | 15993 |
Hi Don, there is a sample project attached to this ticket. Let me know if any additional info is needed. http://support.appcelerator.com/tickets/APP-119465/homepage
Crash log attached.
Don, the crash log is attached. Please let me know if you need anything else.
Verified fixed with both v8 and rhino on Nexus S (2.3.6), Droid 1 (2.2.2), and Galaxy tab 10.1 (3.1) running 1.8.0.1.v20111205011857.
Reopening to edit labels.