我看到一种使用Google文档在线阅读PDF文件的方法...
Android-加载PDF / PDF查看器
有没有办法使用它来查看存储在SD卡中的本地文件?
您可以使用以下代码启动一个意图,让用户选择使用哪个应用程序打开PDF文件,这适用于任何文件和MIME类型。如果用户没有可以打开它的应用程序,则可以显示错误或执行其他必要的操作。
请注意,文件必须是全局可读的,因此如果它位于内部存储器上,则必须将其标记为全局可读,或者它必须位于外部存储器中。
private void openFile(File f, String mimeType)
{
Intent viewIntent = new Intent();
viewIntent.setAction(Intent.ACTION_VIEW);
viewIntent.setDataAndType(Uri.fromFile(file), mimeType);
// using the packagemanager to query is faster than trying startActivity
// and catching the activity not found exception, which causes a stack unwind.
List<ResolveInfo> resolved = getPackageManager().queryIntentActivities(viewIntent, 0);
if(resolved != null && resolved.size() > 0)
{
startActivity(viewIntent);
}
else
{
// notify the user they can't open it.
}
}