Back to project page android-pdfview.
The source code is released under:
GNU General Public License
If you think the Android project android-pdfview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.vudroid.core.utils; /* w ww . java 2 s.c o m*/ import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; public class PathFromUri { public static String retrieve(ContentResolver resolver, Uri uri) { if (uri.getScheme().equals("file")) { return uri.getPath(); } final Cursor cursor = resolver.query(uri, new String[]{"_data"}, null, null, null); if (cursor.moveToFirst()) { return cursor.getString(0); } throw new RuntimeException("Can't retrieve path from uri: " + uri.toString()); } }