2014-11-02 138 views
1

嗨我想創建一個應用程序接受來自其他應用程序的文件。我試過這個教程,http://developer.android.com/training/secure-file-sharing/setup-sharing.html以及這個,http://code.tutsplus.com/tutorials/android-sdk-receiving-data-from-the-send-intent--mobile-14878,似乎沒有任何工作。Android之間共享應用程序之間的文件

這裏是我的清單,

... 

<activity 
      android:name="com.example.activities.mainActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
      <intent-filter> 
       <action android:name="android.intent.action.SEND_MULTIPLE" /> 

       <category android:name="android.intent.category.DEFAULT" /> 

       <data android:mimeType="application/*" /> 

      </intent-filter> 
     </activity> 
... 

但仍然由於某種原因,我的應用程序將不會出現,如果我試圖用它來自收件箱或其他任何共享文件。我嘗試了不同的MIME類型,使用SEND而不是SEND_MULTIPLE,並啓動了一個乾淨的應用程序項目,但沒有任何內容。 謝謝

編輯: 基本上我想要做的是讓我的應用程序顯示在所有其他應用程序的共享菜單。我設法使用...彈出一個完整的動作,但這不是我要找的。不幸的是,所有的谷歌搜索都會導致上述信息

+0

看看aosp中郵件客戶端的清單:https://github.com/android/platform_packages_apps_email/blob/master/AndroidManifest.xml – 2014-11-02 17:43:28

+0

謝謝@ChrisStratton。我試圖通讀並將他們的清單中的任何相關內容添加到我的內容中(甚至嘗試了所有權限),但我仍然沒有收到任何內容。有什麼需要在應用程序級別執行? – andy9775 2014-11-08 01:06:35

回答

0

我相信我已經解決了它。對於MIME類型而不是有"application/*"所有你需要的是*/*。出於某種原因,大多數文件都以文本/純MIME類型打開,包括Excel文件。奇。

相關問題