private Bitmap getViewBitmap(View v) {        v.clearFocus();        v.setPressed(false);        boolean willNotCache = v.willNotCacheDrawing();        v.setWillNotCacheDrawing(false);        // Reset the drawing cache background color to fully transparent        // for the duration of this operation        int color = v.getDrawingCacheBackgroundColor();        v.setDrawingCacheBackgroundColor(0);        if (color != 0) {            v.destroyDrawingCache();        }        v.buildDrawingCache();        Bitmap cacheBitmap = v.getDrawingCache();        if (cacheBitmap == null) {            Log.e("TTTTTTTTActivity", "failed getViewBitmap(" + v + ")", new RuntimeException());            return null;        }        Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);        // Restore the view        v.destroyDrawingCache();        v.setWillNotCacheDrawing(willNotCache);        v.setDrawingCacheBackgroundColor(color);        return bitmap;    }

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android机顶盒 获取当前连接网络的Ip地址
  2. android 如何判断程序是否在前台运行
  3. Android播放循环播放本地图片
  4. Android(安卓)键盘弹出与隐藏
  5. Android仿iOS时间选择器
  6. Android(安卓)摄像头聚焦
  7. Android: annoying exception Unable to
  8. android 沉浸式状态栏不会和虚拟重叠
  9. Android——Notifications笔记
  10. Android(安卓)HelloWorld