在引用SurfaceView的Activity里面写了禁用home键的操作
public void onAttachedToWindow() {
super.onAttachedToWindow();
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
} 然后布局就不显示了!
注释掉onAttachedToWindow() 之后布局显示正常!
有哪位大神知道是什么原因么?
public void onAttachedToWindow() {
super.onAttachedToWindow();
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
} 然后布局就不显示了!
注释掉onAttachedToWindow() 之后布局显示正常!
有哪位大神知道是什么原因么?
解决方案 »
- android实现延时响铃遇到的问题(100分求助)
- 申请android google map api key 无法打开网页
- Android平台到底能不能通过串口发送AT指令呢,急!!!
- SQLite数据库对存储内容大小有限制吗?
- Android ListView一个问题,请大虾们help
- android 蓝牙模块如何判断设备主动断开
- Android 下UDP接收不到PC端返回的信息
- 请大神指点数据库应该如何设计合理,方便。
- 《第一行代码》出现bug Cannot resolve method 'initMediapayer()'
- Android Studio创建新项目 关于选择Android版本号的问题
- Android studio 画路线
- 安卓电视抓取屏幕的想法设计
<include layout="@layout/scanner_toolbar"/> <FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"> <SurfaceView
android:id="@+id/scanner_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/> <com.google.zxing.view.ViewfinderView
android:id="@+id/viewfinder_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:corner_color="@color/corner_color"
app:frame_color="@color/viewfinder_frame"
app:label_text="二维码/条形码扫描"
app:label_text_color="@color/colorAccent"
app:laser_color="@color/laser_color"
app:mask_color="@color/viewfinder_mask"
app:result_color="@color/result_view"
app:result_point_color="@color/result_point_color"/> </FrameLayout>
根据网上的说法加了 surfaceView.setZOrderOnTop(true);
surfaceView.setZOrderMediaOverlay(true);也不行。