Hello everybody,

i'm trying to show an image launching an activity with intent
ACTION_VIEW, but i get some problems.
Here the code, you can also see some others tries i made below the
commentary //:

String path = .... //getting from a sqlite database

File f = new File(path);
//String extension =
android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(f).toString());
//String mimetype =
android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);

Uri img = Uri.fromFile(f);

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(img);
//or intent.setDataAndType(img,mimetype);
startActivity(intent);

And in the manifest i added this <intent-filter> to the main activity

<intent-filter>
                <action android:name="android.intent.action.VIEW"></
action>
                <data android:scheme="file"></data>
                <category
android:name="android.intent.category.DEFAULT"></category>
</intent-filter>

Well unfortunately the result in LogCat is what in the object that's:
failure taking screenshot for (120x180) to layer 210110

Do anybody knows this error and help me? Tnx!

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

Reply via email to