[TIMOB-10309] Android: Ti.Geolocation.forwardGeocoder() callback is not called for a bad address
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-14T18:23:04.000+0000 |
Affected Version/s | Release 2.1.1 |
Fix Version/s | Sprint 2012-16 API, Release 2.1.2, Release 3.0.0 |
Components | Android |
Labels | SupportTeam, api, module_geolocation, parity, qe-manualtest |
Reporter | Varun Joshi |
Assignee | Ping Wang |
Created | 2012-08-03T11:55:29.000+0000 |
Updated | 2014-08-14T18:23:04.000+0000 |
Description
Issue
When an address is passed into Ti.Geolocation.forwardGeocoder() the callback function is not called and it gets stuck in an infinite loop. It should behave just like it does on iOS where the callback is called upon success/failure. The sample code is attached. On iOS we receive both alerts that the callback was successful and the finished alert. On Android we do not see the alert that the callback was successful just that we started the fowardGeocoder().
Sample Code
{noformat}
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView();
win.add(self);
win.open();
var addr = '94302';
setTimeout(function() {
alert('Start forwardGeocoder for: ' + addr);
try {
Ti.Geolocation.forwardGeocoder(addr, function(evt) {
alert('Foward Geocoder Callback for 94302 Successful');
});
} catch(err) {
alert("Error");
}
}, 2000);
setTimeout(function() {
addr = 'hhhhhhgggggg';
alert('Start forwardGeocoder for: ' + addr);
try {
Ti.Geolocation.forwardGeocoder(addr, function(evt) {
alert('Foward Geocoder Callback for ' + addr + ' Successful');
setTimeout(function() {
alert('finished');
}, 2000);
});
} catch(err) {
alert("Error 2");
}
}, 8000);
{noformat}
Comments
JSON Source
PR https://github.com/appcelerator/titanium_mobile/pull/2700
Steps for functional test: 1. Run the test case in the ticket description on Android. Should see 5 alert dialogs. (before the fix, can only see 2 alert dialogs). 2. Run the test case below on both Android and iOS to see the parity.
Reopening to add fixversion
Release 2.1.2