How to add ActivityIndicator for GPS reading

You must Login before you can answer or comment on any questions.

I want add ActivityIndicator for when reading geocoodinates. how can i add ActivityIndicator for Geolocation.

— asked 10 months ago by shanuka gayashan
1 Comment
  • Provide peace of code , so that we can merge with your existence ones ....

    — commented 10 months ago by Moiz Chhatriwala

1 Answer

How about something like this:

function location_callback (e)
{
    ai.hide ();
    if (Ti.Platform.name === 'iPhone OS')
    {
       _self.remove (ai);
    }
}
 
var ai = Titanium.UI.createActivityIndicator({
    message: "getting location..."
});
 
if (Ti.Platform.name === 'iPhone OS')
{
    _self.add(ai);
}
 
ai.show();
 
Ti.Geolocation.addEventListener('location', location_callback);
where _self is the current window or view.

Your Answer

Think you can help? Login to answer this question!