activity结构与AIDL

来源:互联网 发布:linux装telnet包 编辑:程序博客网 时间:2024/06/06 05:04

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执行远程函数调用。








阅读全文
0 0