たとえば、k9-Mailは、いくつかの添付ファイルを処理するアプリケーションを見つけようとし、電子メールのMimeType-Specificationを使用します。
たとえば、PDFの場合、正しい(デバッグ情報)を送信します。
12-27 15:41:58.992: I/ActivityManager(119): Starting: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/3/VIEW typ=application/pdf flg=0x3880001 cmp=com.adobe.reader/.AdobeReader } from pid 119
ただし、メールがMimeType "application/pdf"ではなく"'application/ pdf'"でPDFを添付している場合は、機能しません。:-(これはブロードキャストになります:
12-27 15:35:15.007: I/ActivityManager(119): Starting: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/2/VIEW typ='application/pdf' flg=0x80001 } from pid 3635
最初と最後の'により、IMHOは、それを処理するアプリケーションが見つかりません。:-(
K9-Mailは他のいくつかのマッピングを見逃しているので、私の考えは、呼び出しをキャッチして転送する小さなアプリケーションを構築することでした。しかし、例えば、リーダーは開かれていません。私はそれを試しました:
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
Log.i(TAG, "Activity is called and created");
mapping.put("'application/pdf'", "application/pdf");
String type = getIntent().getType();
if (mapping.containsKey(type)) {
Log.i(TAG, "found mapping: " + type + " => " + mapping.get(type));
Log.v(TAG, "Intent before: " + getIntent().toString());
Intent i = new Intent(getIntent().getAction(), getIntent().getData());
i.setType(mapping.get(type));
i.setData(getIntent().getData());
i.setFlags(getIntent().getFlags());
Log.v(TAG, "Intent after: " + getIntent().toString());
startActivity(i);
}
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i(TAG, "Activity is destroyed");
}
「cmd」の何かが間違っていると思います...デバッガーが表示するので
12-28 08:38:51.445: V/ActivityForwardIntent(1195): Intent after: Intent { act=android.intent.action.VIEW dat=content://com.fsck.k9.attachmentprovider/01549957-459d-4ee3-b568-7e59390a9535/2/VIEW typ='application/pdf' flg=0x80001 cmp=de.blablupp.android.testproject/.ActivityForwardIntent }
誰かが私を助けることができますか?PDFアプリケーションがコンテンツを取得できない可能性はありますか?しかし、PDFアプリケーションが選択可能またはstartetであることがわかりません。:-(
1つの質問もあります-cmpとはどういう意味ですか?そして、どうすればこの情報を新しいインテントに設定できますか?
コンテンツを保存してファイルブラウザで起動するのは本当に面倒なので、この問題を解決したいと思っています。
tiaとreagards
ナウニ