Android intends to share text / open data in Google Drive

I created a simple notepad application that implements the intention of share of ACTION_SEND to share notes.

My data is of the mime type "text / plain" and Google Drive (formerly Google Docs), offered as a choice on my device, when I select Google Drive, I get the error message "This item cannot be downloaded as Google Docs" through the message Toast.

I create my share as follows:

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);

Applications like Mail, Messaging, Twitter, and Wordpress seem to do the job well and have at least EXTRA_TEXT content.

I wonder if there is a way that would allow Google Drive to successfully upload a note, or at least handle the intention better?

Android, , , , . SDK 15, .

: Screen shot showing error message

LogCat :

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

, :

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 Google Collections to your system class path.
05-13 23:31:46.250: W/ND(14594): java.io.FileNotFoundException: com/google/inject/internal/Finalizer.class
05-13 23:31:46.250: W/ND(14594):    at NE.a(FinalizableReferenceQueue.java:269)
05-13 23:31:46.250: W/ND(14594):    at NE.a(FinalizableReferenceQueue.java:253)

, .

LogCat , .

+3
2

Google, ( ) , :

    Intent intent = new Intent(android.content.Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + your_file_path));
    startActivity(Intent.createChooser(intent, ""));
+11

, , Google . , .

" " . , - Google factory .

0

All Articles