myq_26 2013-07-10 09:10 采纳率: 16.7%
浏览 2268

在 android 程序中不能打开PDF

我在程序中创建了一个可扩展的列表,当我点击一个 child 时我想打开一个PDF。现在 PDF 不能打开,显示一个信息说程序中的内容找不到。
打开 PDF 的代码是:

 public boolean onChildClick (
        ExpandableListView parent, 
        View v, 
        int groupPosition,
        int childPosition,
        long id) {
    Log.d( LOG_TAG, "onChildClick: " + childPosition );

    File file = new File("http://www.ratt.ro/grafice/e2-a.pdf");
    Uri path = Uri.fromFile(file);
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    intent.setDataAndType(path, getString(R.string.application_type));
    try 
    {
        startActivity(intent);
    } 
    catch (ActivityNotFoundException e) 
    {
        Toast.makeText(ElistCBox.this, 
            getString(R.string.no_application_found), 
            Toast.LENGTH_SHORT).show();
    }
    return false;
}
  • 写回答

1条回答

  • JaveZh 2013-07-11 00:45
    关注

    android本身是不支持pdf的,你有装office软件吗

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog