我的应用程序处理类型“text/plain”的 Intents ACTION_VIEW,因此我可以用它打开 .txt 文件。我从任何程序打开这些文件都没有问题,当我想从电子邮件中“打开”附件时,从 Gmail 中打开这些文件一切正常。当我想“预览”附件时出现问题 - gmail 给了我不同的意图。如何处理?我比较了 OPEN 和 PREVIEW 的 Intent:
OPEN:
START OF INTENT!
action = android.intent.action.VIEW
getDataString = file:///mnt/sdcard/download/anime_rozne-1.txt
getData = file:///mnt/sdcard/download/anime_rozne-1.txt
getCategories = null
getComponent = {pl.my.package.deszyfrator/pl.my.package.deszyfrator.MainActivity}
getExtras = null
getPackage = null
getScheme = file
getType = text/plain
END OF INTENT!
PREVIEW:
START OF INTENT!
action = android.intent.action.VIEW
getDataString = content://gmail-ls/messages/my.email@0gmail.com/129/attachments/0.1/BEST/false
getData = content://gmail-ls/messages/my.email@gmail.com/129/attachments/0.1/BEST/false
getCategories = null
getComponent = {pl.my.package.deszyfrator/pl.my.package.deszyfrator.MainActivity}
getExtras = null
getPackage = null
getScheme = content
getType = text/plain
END OF INTENT!
我该怎么办?
content://gmail-ls/messages/my.email@gmail.com/129/attachments/0.1/BEST/false