android - 如何使用手机的 native 应用程序打开图像 - Cordova/phonegap

标签 android ios jquery-mobile cordova cordova-3

我有一张图片的链接。图像托管在服务器中。现在单击按钮或单击图像,我想使用 native 应用程序打开该图像。就像在 android 图像查看器或 iOS 图像查看器中,这样我就可以放大或缩小等。

<a href="http://www.example.com/potenga3.jpg" class="" title="Potenga 3">
    <img src="img/thumb/potenga3_t.jpg" alt="image" class="one_third">
</a>

我试过了。

<a href="#" onclick="window.open('file:///path_to_image', '_system', ' ');">Image</a>

没用。什么是简单的方法来做到这一点。如果 ios 和 android 操作系统不存在通用解决方案,您现在可以建议我只针对 android。

最佳答案

我需要使用 android 的 native 代码

    Intent intent = new Intent();
     intent.setAction(Intent.ACTION_VIEW);
     intent.setDataAndType(Uri.parse(fileURI), "image/jpeg");
     startActivity(intent);

关于android - 如何使用手机的 native 应用程序打开图像 - Cordova/phonegap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22680711/

相关文章:

javascript - PWA 无法在 iPhone/iPad 上以全屏模式打开

ios - 如何解决ObjCHiredis redis的setUp block

java - 在布局之间更改大小

android - android studio中的junit测试类

iphone - 组合页面控件+ ScrollView (包括 ImageView )+ TextView

android - 如何在 Android HDPI 设备上使用 JQuery Mobile 修复视口(viewport)缩放

javascript - 用于混合应用程序的 Angularjs 或 jQuery Mobile?

android - Android Froyo 上的 Wi-Fi Direct 支持

android - 透明状态栏

javascript - jQuery Mobile 中的 onClick 事件不起作用