
本文共 5507 字,大约阅读时间需要 18 分钟。
������Binder���������������������������������
Binder���������������������������������������������������������Android���������������������������������������������������������������������������������������������������������������������������������������������������������������
���Binder���������������������������������Binder������������������������������������������������������������������������ServiceManager���SM���������������������������������������������������������������Server���������������������������
1.1 Binder������������
Binder������������������������������������������������������������
- ���A���������������Client���������B���������������Server���������������������������������������Phonebook���������B������������������
- ���Binder������ServiceManager������������������������������Binder���������������������������������
���Binder���������������������������ServiceManager������������������������"������������"���������������������������������������
1.2 Binder������������
Binder������������������������������������������������
������������������������������������������������������������������������������������������
1.3 Binder������������������������
Binder���������������������������������������������������������������������������������
- SERVICESHELL���ServiceManager���SM���������������������������������Server��� Redistribution���
- ������������������������������������������������������SM������������������"������������"���������"������������"���������������������������������
- ������Binder���������������������������������������������������������������������objectProxy������������������������������������������������������������������������������������������������������
- ������������������������������������������������������������
������������������������Binder���������������"������������"���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Binder������������������������������������������������������������������Proxy Pattern������
������Intent���������������������������������������
������������������Intent���������������������������������������������������������������������
������������������������������������������������������������������Android���������������������������������������������������������������������������������Binder���������������������������������������������������������������������������������
���������������������������������
���Android������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������
������MVP������Presenter������������������������������
Presenter������MVP������������������������������View���Model���������������������������������������UI���������������������������������������������������������������������������������
public class Presenter implements IPresenter, Observer { private final Context context; private final View view; private final Model model; public Presenter(View view, Model model, Context context) { this.view = view; this.model = model; this.context = context; bindView(); attachView(view); } @Override public void detachView() { attemptDetach(); unbindView(); destroyModel(); } private void bindView() { // ���������UI��������������������� } private void unbindView() { // ������UI��������������������� } private void attemptDetach() { // ���������������detach������ } private void destroyModel() { // ��������������������������� }}
Presenter������������������������������������������������
���������������������Presenter���������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
