2

フォルダ「/mnt/sdcard/Download/baby_details.doc」にWord文書(後でPDFも作成しますが、今はWord文書を選択します)と、これを開くために設定したアプリケーションタイプがあります。ドキュメントは「application/msword」です。

私の日食LogCatで、ネイティブのandroidアクティビティによってWordドキュメントがどのように開かれるかを監視していましたが、結果は次のように表示されます。

Starting: Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/Download/per-general-business-letter.doc typ=application/msword flg=0x10000000 cmp=com.qo.android.moto/com.qo.android.quickoffice.QuickofficeDispatcher } from pid 24132
Starting: Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/Download/per-general-business-letter.doc typ=application/msword flg=0x1 cmp=com.qo.android.moto/com.qo.android.quickword.Quickword } from pid 1591
Start proc com.qo.android.moto:Quickword for activity com.qo.android.moto/com.qo.android.quickword.Quickword: pid=2452 uid=10010 gids={3003}

だから私はドキュメントを開こうとしました

                Bundle bundle = new Bundle();
                bundle.putString("dat", "/mnt/sdcard/Download/baby_details.doc");
                bundle.putString("typ", "application/msword");
                Intent docClient = new Intent(Intent.ACTION_VIEW);
                docClient.putExtras(bundle);
                docClient.setClassName("com.qo.android.moto", "com.qo.android.quickword.Quickword");
                startActivityForResult(docClient, WORD_APP);

しかし、不明なソースを取得しました。また、setClassNameを次のように変更してみました。

docClient.setClassName("com.qo.android.moto", "com.qo.android.quickoffice.QuickofficeDispatcher");

それでも同じエラーが発生します。

誰かがネイティブのQuickOfficeアクティビティを使用してword/pdf / xlsを開いたことがあるかどうか知りたいですか?

ありがとう、サナ。

4

1 に答える 1

2

「dat」と「type」をバンドルに入れないでください。Intent.setTypeおよびを使用しますintent.setData(または単に使用しますintent.setDataAndType。また、データに使用するURIがシステムが期待するものと一致することを確認してください(file://)。

于 2011-03-24T20:06:03.027 に答える