看板 AndroidDev 關於我們 聯絡資訊
各位大大好 我在自己的app中儲存影像檔案在sdcard中 (於特定目錄) 在其它app想要獲取我app的影像檔案的時候 這部分我要如何傳給其它app呢? 我參考網路上寫了一些,但是試了數天都沒成功QQ 目前進度: 目前 manifest 中: <activity android:name=".VideoSelectionActivity" android:label="@string/app_name" > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.PICK" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.OPENABLE" /> <data android:mimeType="video/*" /> </intent-filter> </activity> 然後在 VideoSelectionActivity的 onResume 程式碼 Intent intent = new Intent(); intent.setData(Uri.parse("sdcard/my app/videos/video001.mp4")); setResult(Activity.RESULT_OK, intent); finish(); 我參考的網址: http://stackoverflow.com/questions/11933984 請問是哪邊出了問題呢? 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.21.125.247 ※ 文章網址: http://www.ptt.cc/bbs/AndroidDev/M.1399006590.A.655.html
Ansaga:這段程式碼是開網頁用的吧? 05/02 15:01
issuemylove:不是吧@@?? 1F這樣說我開始不確定了@@" 05/02 15:04
Ansaga:http://goo.gl/UcuSk5 這頁應該有幫助 05/02 15:05
Ansaga:沒有set好像是開網頁 要設定type的樣子 05/02 15:05
Ansaga:我是沒這樣用過啦 我都是自己放mediaplayer播XD 05/02 15:06
issuemylove:ㄜ@@ 我想大大誤會我的意思了 等等重新敘述問題 抱歉 05/02 15:08
我想完成的事情是如照片中所敘述 step 1: http://ppt.cc/uM2Y step 2: http://ppt.cc/p~fh step 3: http://ppt.cc/rno0 我想要實現的就是step 2中的 VideoPlayer 那種分享檔案給Line的功能 ※ 編輯: issuemylove (211.21.125.247), 05/02/2014 15:19:56
issuemylove:以補上敘述@@...希望大大們了解小小的問題 感恩感恩 05/02 15:20
issuemylove:已 05/02 15:20
※ 編輯: issuemylove (211.21.125.247), 05/02/2014 15:21:46
passli:猜是路徑的問題 http://stackoverflow.com/a/20523505 05/03 00:09
finaloltry:你餵給Uri.parse的參數是不合法的 Uri string 05/03 09:32
finaloltry:正常uri string應該是file:///tmp/android.txt 05/03 09:33
issuemylove:試過樓上的方法了@@||| 但還是不行 05/03 14:38
issuemylove:pass大的路徑問題也看過了 應該也不是那個問題QQ 05/03 14:38
issuemylove:我自己的猜想是 會不會這種方式是錯誤的 必須用其它 05/03 14:39
issuemylove:方法 05/03 14:39
issuemylove:orz? 05/03 14:39
sulf:new Intent(Intent.ACTION_VIEW) 05/04 06:56
ChonPiggy:不傳檔案過去而是傳路徑過去讓另外一個App使用路徑去抓? 05/10 17:23
ChonPiggy:我沒實做過我亂猜的 哈 感覺不知道會不會有權限問題 05/10 17:24
issuemylove:後來我放棄了= =" 等待有緣人 05/12 10:26