我正在创建一个Android类库,它调用内部REST API,并且还使用需要Context的Android的Geocoder类(特别是getFromLocation()).我打算让库成为一个IntentService来允许它以异步方式运行,但是我无法弄清楚如何处理Context(GeoLoc调用是在一个单独的类中,它是IntentService调用的库的一部分).
我的问题是,如何从IntentService中获取实例化android.location.Geocoder所需的上下文?
android android-intent
android ×1
android-intent ×1