I am using the following code to save the bitmap
Using java Syntax Highlighting
- Bitmap screenshot;
- mView.setDrawingCacheEnabled(true);
- screenshot = Bitmap.createBitmap(mView.getDrawingCache());
- mView.setDrawingCacheEnabled(false);
- try {
- FileOutputStream fos = new FileOutputStream("/sdcard/test.png");
- screenshot.compress(Bitmap.CompressFormat.PNG, 100, fos);
- fos.close();
- } catch (FileNotFoundException e) {
- Log.d("FileNotFoundException: " + e.getMessage());
- } catch (IOException e) {
- Log.d("IOException: " + e.getMessage());
- }
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
it works fine unless i put the following in my onCreate() to make sure I am in full screen mode
Using java Syntax Highlighting
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
when that code is in there I get a NullPointerException at createBitmap()
does anybody know why this would be happening?