On Mon, May 9, 2011 at 1:11 AM, Ankit Shah <[email protected]> wrote:
> I would like to open/view PDF/Doc files stored in internal storage
> (i.e "file:///data/data/<package_name>/files/test.pdf")
>
> Is there any way to generate Uri object for file stored in internale
> storage
> (i.e "file:///data/data/<package_name>/files/test.pdf")
Use Uri.fromFile().
> Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
> Uri data = Uri.fromFile("file:///data/data/<package_name>/files/
> test.pdf");
A String is not a File. Use a File with Uri.fromFile().
Also, bear in mind that this won't work for your desired purposes
unless the file is world-readable. You can also create a
ContentProvider to serve a local file, then use the content:// Uri in
your Intent.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training...At Your Office: http://commonsware.com/training
--
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