添加代码

public void onConfigurationChanged(Configuration newConfig) {super.onConfigurationChanged(newConfig);DisplayMetrics mDisplayMetrics = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);int W = mDisplayMetrics.widthPixels;int H = mDisplayMetrics.heightPixels;if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {imageSurfaceView.getLayoutParams().width = W;imageSurfaceView.getLayoutParams().height = H;}else{imageSurfaceView.getLayoutParams().width = W;imageSurfaceView.getLayoutParams().height = H;}}


android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"            android:launchMode="singleTask"            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >                                                                                



更多相关文章

  1. Android 滑动效果代码分享
  2. Android点击按钮实现全屏的代码
  3. Android开关机代码
  4. android 设置默认launcher 附上代码
  5. Android通过代码自动连接WiFi
  6. Android service: startService的代码实现
  7. 【代码】利用Android的Log 演示一个activity的生命周期

随机推荐

  1. 现代浏览器探秘(part2):导航[每日前端夜
  2. 用Python和Tableau对母婴商品销量进行数
  3. 浅议 Promise/Futures 模型 [每日前端夜
  4. 1-20
  5. 现代浏览器探秘(part3):渲染 [每日前端夜
  6. 自学系列 | 就谈知识体系!
  7. Python异步爬虫进阶必备,效率杠杠的!
  8. Ansible 之 外部变量文件调用
  9. JavaScript的工作原理:引擎、运行时和调用
  10. 图解「剑指Offer」之二维数组中的查找