I want to Access findViewById()
from an Service without passing it as an parameter or intent in the constructor of the service, Is that possible?
Her my code:
public class ManageDataService extends Service implements LocationListener {
public void onCreate() {
TextView longitudeField = (TextView) findViewById(R.id.overview_position_longitude);
}
}
I have to get the Activity's context somehow, right?
I didn't find any matching solutions on the internet.
It's really bad idea to update UI form service. I think good approach to to it is usage of BroadcastReceivers data Observer. Just register one for your activity and pass value to update UI.