Problem description
App crashes when accessing to contacts in Address Book on Android OS 4.0
Steps to reproduce
- Run the sample code below
- Click the button and get to the Address Book contact list.
- Click on a contact, then get back to the app
Result: app crashes.
Crash not reproducible on Android OS 2.3.3
Attaching crash log.
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var info = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
// Create a Button.
var btn1 = Ti.UI.createButton({
title : 'btn1',
height : 50,
width : 300,
bottom : 50
});
var values = {
cancel:function() {info.text = 'Cancelled';},
selectedPerson : function() {info.text = "select";}};
// Listen for click events.
btn1.addEventListener('click', function() {
Titanium.Contacts.showContacts(values);
});
// Add to the parent view.
win1.add(btn1);
win1.add(info);
win1.open();
Additional notes
Customer ticket:
http://support-admin.appcelerator.com/display/APP-461234
Putting it back in queue
This appears to be caused by closing a Cursor from a managed query. On ICS this results in a fatal exception when the activity which created the managed query resumes. Worked with Hieu on a solution that seems to fix the issue. He will be sending a PR for the fix and wrapping up this issue.
Closing as fixed. Verified with: Titanium Studio, build: 2.1.0.201206221045 Titanium SDK: 2.1.0.v20120622174154 Devices: Nexus S (4.0.4); Samsung Galaxy tab (3.2)
Anvil test case added. PR Link: https://github.com/appcelerator/titanium_mobile/pull/5380