【Android】17.0 第17章 服务绑定—本章示例主界面

分类:C#、Android、VS2015;

创建日期:2016-03-03

一、简介

通过服务绑定(Bound Services),可以轻松实现后台服务与界面(UI)的交互。

二、本章示例主界面

1、运行截图

image

2、MainActivity.cs文件中对应的代码

chItems.Add(new Chapter()
{
    ChapterName = "第17章 服务绑定",
    ChapterItems = new ChItem[]
    {
        new ChItem { type = typeof(ch1701BindingActivity), Title="例17-1 绑定到LocalService", Desc = "演示绑定到 Local Service 的基本用法" },
        new ChItem { type = typeof(ch1702MainActivity), Title="例17-2 绑定到StartedService", Desc = "演示绑定到 Started Service 的基本用法" },
        new ChItem { type = typeof(ch1703MainActivity), Title="例17-3 绑定到IntentService", Desc = "演示绑定到 IntentService 的基本用法" },
        new ChItem { type = typeof(ch1704MainActivity), Title="例17-4 利用Messenger实现进程间通信", Desc = "演示利用Messenger实现进程间消息通信的基本用法" },
    }
});
原文地址:https://www.cnblogs.com/rainmj/p/5237261.html