题目内容

通过调用bindService() 方法绑定的 Service 对象,可以通过调用________________ 方法解除绑定。

查看答案
更多问题

在绑定模式下, Activity解除与 Service 绑定时,将依次回调用Service的________________和 onDestroy() 方法退出绑定。

Service作为应用组件需要在________________文件中进行注册才能生效。

启动Service的编程方式之一是先创建目标为Service类的________________类对象,将该对象作为startService()方法参数启动Servic类。

请阅读并理解下面程序,在描述编程逻辑文字的空白划线处填写合适内容。public class MyService extends Service {private DownloadBinder mBinder = new DownloadBinder();class DownloadBinder extends Binder {public void startDownload() {Log.d("MyService", "startDownload executed");}public int getProgress() {Log.d("MyService", "getProgress executed");return 0;}}@Overridepublic IBinder onBind(Intent intent) {Log.d("MyService", "onBind executed");return mBinder;}…..@Overridepublic void onDestroy() {super.onDestroy();Log.d("MyService", "onDestroy executed");}}1)自定义类(1)_____________继承于(2) _____________类;2)该自定义类内部定义了一个继承自(3)_____________类的名为(4)_____________内部类,该内部类的功能是为Activity提供服务方法(5)_____________和(6)_____________;2)定义了名为(7)_____________ 的Binder类对象;3)(8)_____________回调方法在收到绑定意图后会返回名为(9)_____________的对象,Activity可以通过这个对象调用Service提供的服务方法。4)在(10)_____________回调方法中编写Service类销毁时的处理代码。

答案查题题库