小编Rus*_*lde的帖子

Android意图将文本/纯文本数据共享到Google云端硬盘

我创建了一个简单的记事本应用程序,它实现了ACTION_SEND共享意图来共享笔记.

我的数据具有的MIME类型为"text/plain的"和谷歌驱动器(原谷歌文档)是提供作为我的设备上的选择,当我选择谷歌驱动器出现错误通过"此项目不能被上传的谷歌文档"吐司留言.

我像这样创建我的共享意图:

Intent share_intent = new Intent(android.content.Intent.ACTION_SEND);

share_intent.setType("text/plain");
share_intent.putExtra(android.content.Intent.EXTRA_SUBJECT, name);
share_intent.putExtra(android.content.Intent.EXTRA_TEXT, content);

startActivity(share_intent);
Run Code Online (Sandbox Code Playgroud)

像Mail,Messaging,Twitter和Wordpress这样的应用程序似乎都很好地处理了这个意图并至少分享了EXTRA_TEXT内容.

我想知道是否有一种方法可以让Google Drive成功上传笔记,或者至少更好地处理意图?

我是Android新手所以请原谅我的愚蠢,如果这是一个愚蠢的问题.我正在针对最低版本的SDK 15开发,如果这有帮助的话.

这是一个错误消息的屏幕抓取: 屏幕截图显示错误消息

在LogCat中,我再次发现了错误消息:

05-13 23:31:46.906: E/UploadSharedItemActivity(14594): This item cannot be uploaded as Google Document.
Run Code Online (Sandbox Code Playgroud)

在错误消息之前还会出现警告:

05-13 23:31:46.250: W/ND(14594): Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move …
Run Code Online (Sandbox Code Playgroud)

android android-intent google-drive-api

3
推荐指数
1
解决办法
5625
查看次数

标签 统计

android ×1

android-intent ×1

google-drive-api ×1