Am using Textureview.getBitmap() to grab frames every second from a Camera preview. it works perfectly except that it causes the main Ui thread to be Sluggish and sometimes even crash. please what do i need to do??.thanks
Here is my Code:
       mCountDownTimer=new CountDownTimer(7000,500) {
            @Override
            public void onTick(long millisUntilFinished) {
                Log.v("Log_tag", "Tick of Progress"+ i+ millisUntilFinished);
                i++;
                mProgressBar.setProgress(i);
               Bitmap bmps = mTextureView.getBitmap();
               ByteArrayOutputStream out = new ByteArrayOutputStream();
               bmps.compress(Bitmap.CompressFormat.JPEG , 0, out);
               rev.add(bmps);
            }
            @Override
            public void onFinish() {
            //Do what you want 
                i++;
                mProgressBar.setProgress(i);
                mCountDownTimer.cancel();
            }
        };
 
     
    