Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4643] Application crashes if a custom theme is included in the project

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-05T10:30:57.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-31, Release 1.8.0
ComponentsAndroid
Labelsplatform_android, qe-testadded
ReporterAnirudh Nagesh
AssigneeEric Merriman
Created2011-07-12T13:30:19.000+0000
Updated2014-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

FileDateSize
console.txt2011-07-12T13:59:55.000+000015993

Comments

  1. Ben Bahrenburg 2011-07-12

    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
  2. Anirudh Nagesh 2011-07-12

    Crash log attached.
  3. Anirudh Nagesh 2011-07-13

    Don, the crash log is attached. Please let me know if you need anything else.
  4. Eric Merriman 2011-12-05

    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.
  5. Eric Merriman 2012-01-05

    Reopening to edit labels.

JSON Source