0
Titanサンプルの次のコードは、iPhoneではうまく動作しますが、Androidではうまく動作しません。誰かがこれがAndroid 2.3.3でも動作するように書かれる方法を私に見せてもらえますか?私が 'Ti.Geolocation.getCurrentPosition'とそれを終了タグとコメントアウトすると、エラーは表示されません。Appcelerator Androidでジオロケーションが動作しない
if (!_bounty.captured) {
var captureButton = Ti.UI.createButton({
title:L('capture'),
top:10,
height:30,
width:200
});
captureButton.addEventListener('click', function() {
if (Ti.Geolocation.locationServicesEnabled) {
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.getCurrentPosition(function(e) { //*causes error on Android*
var lng = e.coords.longitude;
var lat = e.coords.latitude;
bh.db.bust(_bounty.id, lat, lng);
bh.net.bustFugitive(Ti.Platform.id, function(_data) {
Ti.UI.createAlertDialog({
message:_data.message
}).show();
//on android, give a bit of a delay before closing the window...
if (Ti.Platform.osname == 'android') {
setTimeout(function() {
win.close();
},2000);
}
else {
win.close();
}
});
});
}
else {
Ti.UI.createAlertDialog({
title:L('geo_error'),
message:L('geo_error_details')
}).show();
}
});
win.add(captureButton);
}
助けてください。
エラーメッセージは何ですか?どのTiバージョン? –
Tiバージョン1.7.5、 ランタイムエラー: \t場所:android_asset/Resources/ui.js; \tメッセージ:構文解析中に再帰が多すぎます – basheps
Android用Tiバグのように聞こえます。以前のバージョンのTi Mobile SDKを試してみましたか? –