I want to show png or jpg, which I downloaded from the following with the intention of viewing images, but I can not get it to work.
Bitmap bmp = getImageBitmap(jpg); String path = getFilesDir().getAbsolutePath() + "/test.png"; File file = new File(path); FileOutputStream fos = new FileOutputStream(file); bmp.compress( CompressFormat.PNG, 100, fos ); fos.close(); Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(path)), "image/png"); startActivity(intent);
I know that the bitmap is loaded in order (use the same procedure to deliver it to ImageView instances elsewhere in my application). I think he wrote the file in order, I see it on disk, and the file size is correct. Startup started, but an exception is thrown:
ERROR / ImageManager (1345): got bitmap decoding decoding java.lang.NullPointerException
then the new activity just sits there, empty. How it works?
android
Mark Nov 16 '09 at 7:37 2009-11-16 07:37
source share