android.view.Window.takeSurface()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中android.view.Window.takeSurface()方法的一些代码示例,展示了Window.takeSurface()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.takeSurface()方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:takeSurface

Window.takeSurface介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  LocalActivityManager lam = getLocalActivityManager();

  Intent intent = new Intent();
  intent.setClass(this, TeapotNativeActivity.class);

  Window window = lam.startActivity("xxx", intent);

  // reflect call "willYouTakeTheSurface"
  NativeActivity callback = JavaCalls.callMethod(window.getDecorView(), "willYouTakeTheSurface");
  if (callback != null) {
    window.takeSurface(null);
    getWindow().takeSurface(callback);
    getWindow().takeInputQueue(callback);
  }

  setContentView(window.getDecorView());

}

代码示例来源:origin: qiubiteme/android_api_demos

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  
  // Tell the activity's window that we want to do our own drawing
  // to its surface.  This prevents the view hierarchy from drawing to
  // it, though we can still add views to capture input if desired.
  getWindow().takeSurface(this);
  
  // This is the thread that will be drawing to our surface.
  mDrawingThread = new DrawingThread();
  mDrawingThread.start();
}

代码示例来源:origin: THEONE10211024/ApiDemos

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  
  // Tell the activity's window that we want to do our own drawing
  // to its surface.  This prevents the view hierarchy from drawing to
  // it, though we can still add views to capture input if desired.
  getWindow().takeSurface(this);
  
  // This is the thread that will be drawing to our surface.
  mDrawingThread = new DrawingThread();
  mDrawingThread.start();
}

相关文章

微信公众号

最新文章

更多

Window类方法