在我的Andr​​oid应用程序查看Excel文件 [英] Viewing excel files in my android app

查看:147
本文介绍了在我的Andr​​oid应用程序查看Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Android应用程序中,我要打开和放大器;关闭Excel按钮点击文件。这些Excel文件将是只读的。关闭Excel文件后,就应该直接我的应用程序。

I'm working on an Android app in which I have to open & close excel files on button click. These excel files will be readonly. After closing the excel file, it should direct me to the app.

请给我建议的方式来做到这一点。

Please suggest me a way to do this.

推荐答案

在这里是一个手动路由。

here is a manual route.

如何读取使用JXL excel文件2.6.12罐

但这里是一个小更容易之一。

but here is a little more easier one.

<一个href="http://stackoverflow.com/questions/2923265/android-how-do-i-open-another-app-from-my-app/2927296#2927296">open应用

但我猜你必须找出 MIME类型

修改

得到了MIME类型,以及

got the mime type as well

<一个href="http://stackoverflow.com/questions/974079/setting-mime-type-for-excel-document/1964182#1964182">Setting MIME类型的Excel文档

更新

让这样的事情可能会奏效。

so something like this might work.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/vnd.ms-excel");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);


try {
    startActivity(intent);
} 
catch (ActivityNotFoundException e) {
    Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show();
}

这篇关于在我的Andr​​oid应用程序查看Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆