我想findViewById()
从服务访问而不将其作为参数或意图传递给服务的构造函数,这可能吗?
她我的代码:
public class ManageDataService extends Service implements LocationListener {
public void onCreate() {
TextView longitudeField = (TextView) findViewById(R.id.overview_position_longitude);
}
}
我必须以某种方式获取 Activity 的上下文,对吗?
我在互联网上没有找到任何匹配的解决方案。