`
月下独酌
  • 浏览: 127851 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

全屏截图

 
阅读更多
public void onCreate(Bundle savedInstanceState) {
                //
//setContentView(R.layout.main2);
getWindow().getDecorView().setDrawingCacheEnabled(true);
getWindow().getDecorView().measure(  
                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),  
                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));  
getWindow().getDecorView().layout(0, 0, getWindow().getDecorView().getMeasuredWidth(),  
getWindow().getDecorView().getMeasuredHeight());  
 
getWindow().getDecorView().buildDrawingCache();  
Bitmap bi = getWindow().getDecorView().getDrawingCache();
}
分享到:
评论
1 楼 酱油党 2014-02-03  
你这个方法只能截当前activity,想要截取任意地方,怎么办?

相关推荐

Global site tag (gtag.js) - Google Analytics