activity结构与AIDL

1,activity结构:

..\15-1547重画图\0102.tif

系统布局xml文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:fitsSystemWindows="true">
     <!-- Popout bar for action modes -->
     <ViewStub android:id="@+id/action_mode_bar_stub"
                   android:inflatedId="@+id/action_mode_bar"
                   android:layout="@layout/action_mode_bar"
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:theme="?attr/actionBarTheme" />
     <FrameLayout
           android:layout_width="match_parent" 
           android:layout_height="?android:attr/windowTitleSize"
           style="?android:attr/windowTitleBackgroundStyle">
        <TextView android:id="@android:id/title" 
                style="?android:attr/windowTitleStyle"
                android:background="@null"
                android:fadingEdge="horizontal"
                android:gravity="center_vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
     </FrameLayout>
     <!—这里就是开发人员设置的布局所填充的位置-->
     <FrameLayout android:id="@android:id/content"
           android:layout_width="match_parent" 
           android:layout_height="0dip"
           android:layout_weight="1"
           android:foregroundGravity="fill_horizontal|top"
           android:foreground="?android:attr/windowContentOverlay" />
</LinearLayout>

2.AIDL

AIDL就是定义一个接口,客户端(调用端)通过bindService来与远程服务端建立一个连接,在该连接建立时会返回一个IBinder对象,该对象是服务端Binder的BinderProxy,在建立连接时,客户端通过asInterface函数将该BinderProxy对象包装成本地的Proxy,并将远程服务端的BinderProxy对象赋值给Proxy类的mRemote字段,就是通过mRemote执行远程函数调用。








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值