title: Fastest way to rotate big size bitmap
body: <p>I am working with large size images and when I try to rotate them <code>(applying matrix on the bitmap)</code> a lot of seconds occurs.
  I've seen that android system gallery can accomplish this task in a very fast manner instead. How is it possible?</p>
  
  <p>I thought to perform the rotation on an asyncTask, applying only the ImageView rotation (which doesn't take long time) on the main thread, but if the app is killed before the asyncTask get to the end, the app fall in an inconsistent state.</p>
  
  <p>This is my bitmap rotation code, which takes long time execution for large bitmaps:</p>
  
  <pre><code>Matrix mat = new Matrix();
  mat.setRotate(90);
  bMap = Bitmap.createBitmap(bMap, 0, 0, bMap.getWidth(), bMap.getHeight(), mat, true);
  </code></pre>