In Package installer activity.
In PackageInstaller/res/layout/install_confirm.xml
98 <!-- OK confirm and cancel buttons. --> 99 <LinearLayout 100 android:layout_width="match_parent" 101 android:layout_height="wrap_content" 102 android:orientation="vertical" 103 android:divider="?android:attr/dividerHorizontal" 104 android:showDividers="beginning"> 105 106 <LinearLayout 107 style="?android:attr/buttonBarStyle" 108 android:layout_width="match_parent" 109 android:layout_height="wrap_content" 110 android:orientation="horizontal" 111 android:measureWithLargestChild="true"> 112 113 <LinearLayout android:id="@+id/leftSpacer" 114 android:layout_weight="0.25" 115 android:layout_width="0dip" 116 android:layout_height="wrap_content" 117 android:orientation="horizontal" 118 android:visibility="gone" /> 119 120 <Button android:id="@+id/cancel_button" 121 android:layout_width="0dip" 122 android:layout_height="wrap_content" 123 android:layout_gravity="start" 124 android:layout_weight="1" 125 android:text="@string/cancel" 126 android:maxLines="2" 127 style="?android:attr/buttonBarButtonStyle" /> 128 129 <Button android:id="@+id/ok_button" 130 android:layout_width="0dip" 131 android:layout_height="wrap_content" 132 android:layout_gravity="end" 133 android:layout_weight="1" 134 android:text="@string/next" 135 android:maxLines="2" 136 android:filterTouchesWhenObscured="true" 137 style="?android:attr/buttonBarButtonStyle" /> 138 139 <LinearLayout android:id="@+id/rightSpacer" 140 android:layout_width="0dip" 141 android:layout_weight="0.25" 142 android:layout_height="wrap_content" 143 android:orientation="horizontal" 144 android:visibility="gone" /> 145 146 </LinearLayout> 147 </LinearLayout>
filterTouchesWhenObscured attribute mean the button's onClick will not work if there is another view on the top of this button even if the above view is transparent.