[TIMOB-9912] Android: Label: Application crashes on updating textid of label with a key that missing
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-20T07:06:21.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.1.1, Release 3.0.0 |
Components | Android |
Labels | api, module_label, qe-testadded, regression |
Reporter | Satyam Sekhri |
Assignee | Josh Roesslein |
Created | 2012-07-10T03:32:11.000+0000 |
Updated | 2013-11-07T05:27:19.000+0000 |
Description
Updating the textid of a label with a resource key that does not exist in the locale file, throws an exception and crashed the app.
Regression. The issue does not exist in 2.0.2
Steps to Reproduce:
1. Create an application with code below
2. Launch App
Actual Result: The application opens and then crashes. An exception si shown in the console. Please find attched the logs for the same.
Expected: Blank label should be shown.
var win = Titanium.UI.createWindow({
backgroundColor:'white',
});
var view = Ti.UI.createView({
top:0,
height:80,
right:0,
left:0
});
var label = Ti.UI.createLabel({
font:{fontSize:30,fontFamily:'Helvetica Neue'},
color:'red',
left:0,
width:'100%',
//text:'Label1',
textid:'new',
right:'10%',
textid:'check'
});
view.add(label);
Ti.API.info('Updating1');
label.textid='new';
Ti.API.info('Updating2');
label.textid='new';
Ti.API.info('Updating3');
label.textid='new';
Ti.API.info('Updating4');
label.textid='new';
view.addEventListener('click',function(e){
//label.text = 'Label1 is fine';
label.textid='new';
})
win.add(view)
win.open();
This issue is caused by the same bug which was fixed in TIMOB-8774.
Issued resolved and has already been back ported into 2.1.1.
Verified On: SDK: 2.2.0.v20120713210112 Studio: 2.1.1.201207161421 Device: Samsung Tab(V 3.2)
Verified On: SDK: 2.1.1.v20120716180600 Studio: 2.1.1.201207161421 Device: Samsung Galaxy tab(V 3.2) Application does not crash on updating textid of label.
Reopening just to update labels.
Updated label and verified with: Tested on: Device: Nexus 7 tab Android Version 4.1 SDK:3.1.2.v20130619101604 Appcelerator Studio: 3.1.1.201306131423 OS: OSX 10.8 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4787