[ACCEPTED]-View image in ACTION_VIEW intent?-android

Accepted answer
Score: 25

Check out Android issue 2092 it sounds similar to what you 8 are describing. The issue states, "Bitmap.compress() fails 7 for PNG files saved in Indexed Color Mode 6 (instead of RGB color mode)", however 5 the first commenter thinks that, "it 4 looks like its not an indexed color problem 3 but a PNG problem."

It looks like your 2 code is fine, compare it to this Android 1 snippet:

Intent intent = new Intent();  
intent.setAction(android.content.Intent.ACTION_VIEW);  
File file = new File("/sdcard/test.mp4");  
intent.setDataAndType(Uri.fromFile(file), "video/*");  
startActivity(intent);   

Intent intent = new Intent();  
intent.setAction(android.content.Intent.ACTION_VIEW);  
File file = new File("/sdcard/test.mp3");  
intent.setDataAndType(Uri.fromFile(file), "audio/*");  
startActivity(intent); 
Score: 4

Another problem may be permissions on the 6 file. Typically your /data/data/[app]/ directories 5 are not world readable, and are owned by 4 you applications "app_XX" user/group. Either 3 make sure your permissions are correct, or 2 make sure the file is in a place that both 1 applications can read (emms, or sd card)

More Related questions