I have one activity ‘A’ which extends mapActivity which calls service ‘B’, and Service ‘B’ which extends service. I’am getting Latitude and Longitude in service ‘B’. Now i need to call the method in Activity ‘A’ and pass the Latitude and Longitude contineosly as soon as the location is updated. In that method I have code to display the Location. Thanks in advance..
I have one activity ‘A’ which extends mapActivity which calls service ‘B’, and Service
Share
You cant get reference of your Activity from Service unless you set a
STATICreference to it – which is highly not recommended and is considered to be a culprit for memory leak issues.Instead, I would suggest you to make use of android’s broadcasting mechanism using
context.sendBroadcastandBroadcastReceiver.