Screen Capture in android

前端 未结 4 551
时光说笑
时光说笑 2020-11-27 19:35

I want to develop an application that will take screenshot of android screen..does any one know how to do it..? which is similar to koushik duttas screen shot..But with out

4条回答
  •  广开言路
    2020-11-27 19:41

    You can try something like this

    private RelativeLayout view;
    
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        view = (RelativeLayout)findViewById(R.id.relativeView);
    
        View v1 = view.getRootView();
    
        v1.setDrawingCacheEnabled(true);
        Bitmap bm = v1.getDrawingCache();
    }
    

提交回复
热议问题