AndroidApplicationextends Activity implements Application

首先继承了android的Activity,并实现了Application接口

public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config)

{

//创建2D的渲染对象
graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy(): config.resolutionStrategy);

//创建输入对象
input = new AndroidInput(this, graphics.view, config);

//创建音频对象
audio = new AndroidAudio(this);

//创建文件操作对象
files = new AndroidFiles(this.getAssets());


this.listener = listener;


this.handler = new Handler();

Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();

//设置全屏模式

try

{

//没标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
}

catch (Exception ex)

{
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}

//设置全屏模式
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

//也可以用下面的清除Flag
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

//设置运行的显示View

//DefaultGLSurfaceView
setContentView(graphics.getView(), createLayoutParams());


createWakeLock(config);

更多相关文章

  1. Android Bitmap对象与byte[]相互转换
  2. Android 整屏截图与区域指定view或layout截屏并返回bitmap对象
  3. Android 实现夜间模式
  4. 使用意图在Activity之间传递数据小插曲__传递自定义的序列化对象
  5. Android之启动模式
  6. Android M新特性Doze and App Standby模式详解
  7. MTP模式与USB存储模式(MTP in Android)
  8. android Sqlite数据库对象模型ORMLite框架学习
  9. Android StrictMode 严苛模式

随机推荐

  1. Android小例子(点击一个按钮,传递数据给另
  2. Android TextView 设置了maxLines但是不
  3. 基于windows平台的Android原生(Native)C
  4. Android 面试宝典
  5. Android EasyPermissions官方库,高效处理
  6. 【移动开发】Android Animation 动画效果
  7. Android开发中versionCode和versionName
  8. Android自定义Dialog及与Activity的交互
  9. 关于Android中的几个文件目录
  10. Android activity四大启动模式详解