I am having an issue when trying to save a screen shot of a view to a
file.

I am using the following code to save the bitmap

Java:


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());
}


it works fine unless i put the following in my onCreate() to make sure
I am in full screen mode

Java:

getWindow().setFlags
(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);



when that code is in there I get a NullPointerException at createBitmap
()
does anybody know why this would be happening?
_________________
--
Sunny

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to