-
android动态全屏切换
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.view.WindowManager;
- import android.widget.Button;
-
- public class FullScreenTestActivity extends Activity {
- private Button button;
-
-
- private boolean isFulllScreen;
-
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
-
- button = (Button) findViewById(R.id.button);
- button.setOnClickListener(new OnClickListener() {
-
-
- @Override
- public void onClick(View v) {
- isFulllScreen = !isFulllScreen;
- if (isFulllScreen) {
- button.setText("exit_full_screen");
- WindowManager.LayoutParams params = getWindow().getAttributes();
- params.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
- getWindow().setAttributes(params);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
- } else {
- button.setText("full_screen");
- WindowManager.LayoutParams params = getWindow().getAttributes();
- params.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
- getWindow().setAttributes(params);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
- }
- }
- });
- }
- }
-
相关阅读:
电路开发软件积累
.NET移动开发环境搭建
Microsoft SQL Server Express各版本对比
.NET IL指令速查表
C#访问加密的SQLite数据库
C#中时间计算方法汇总
最佳C/C++编辑器 source insight3
常用PHP框架收集
CSS 中文字体的英文名称 (simhei, simsun) 宋体 微软雅黑等
Windows下Java JDK8配置环境变量
-
原文地址:https://www.cnblogs.com/jiezzy/p/2642915.html
Copyright © 2020-2023
润新知