activity和service通信:通过binder 举个我实际项目中的例子:在service中下载更新应用 首先是下载更新apk的service: public class UpdateVersionService extends Service { private final String tag = "young"; private Context context = this; private BaseApplication application; private Down…
BgService代码 public class BgService extends Service { public static final String TAG = "BgService"; private BgBinder binder; @Override public void onCreate() { super.onCreate(); binder = new BgBinder(); Log.d(TAG, "onCreate() executed")…