0
A
回答
4
嘗試使用PackageManager
和getLaunchIntentForPackage()
以及DropBox的包名稱,即com.dropbox.android
。如果Dropbox未安裝,您將獲得PackageManager.NameNotFoundException。
2
如果你想要的是空空的dropbox共享一個文件,你可以使用ACTION_SEND:
Intent intent = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(intent, "title");
您還可以發送一個特定的文件:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(fileType);
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file.getPath()));
startActivity(Intent.createChooser(intent, "title"));
看到這個article瞭解ACTION_SEND後面的約定。
+1
Uri.parse(file.getPath())不起作用。請改用Uri.fromFile(文件)。代碼的最後一行還有一個缺失的緊支架。我試圖編輯答案,但我的編輯被拒絕。 –
相關問題
- 1. 從我的Android應用程序啓動Android應用程序
- 2. 從我的應用程序啓動Android視頻應用程序
- 3. 從我的Android應用程序啓動Adobe Air應用程序
- 4. 我可以從我的應用程序中啓動android應用程序嗎?
- 5. 從我的應用程序啓動外部應用程序
- 6. Android KitKat從應用程序啓動screenrecord從應用程序
- 7. 從我的應用程序啓動Mail.app
- 8. 從鉻啓動我的應用程序
- 9. 啓動其他應用程序從我的應用程序的Android
- 10. 從網站啓動Android應用程序
- 11. 從Android上啓動Instagram應用程序
- 12. 隱藏Android應用程序從啓動
- 13. 從網頁啓動Android應用程序
- 14. 從網絡啓動Android應用程序
- 15. Android:從應用程序內啓動Firefox
- 16. 如何從我的其他應用程序啓動我的應用程序?
- 17. Android應用程序啓動
- 18. 啓動Android應用程序
- 19. 啓動android應用程序
- 20. 如何從我自己的android應用程序啓動電報應用程序?
- 21. 如何從我的應用程序啓動Facebook應用程序?
- 22. 從我的應用程序內啓動本機應用程序?
- 23. 自動阻止應用程序從啓動程序啓動
- 24. 如何從Java Web應用程序啓動Android應用程序?
- 25. 從Ionic應用程序啓動Android應用程序
- 26. 啓動我的android應用程序*在後臺*啓動
- 27. 從多個服務的BroadcastReceiver啓動Android啓動應用程序
- 28. 從應用程序啓動「啓動器應用程序抽屜」?
- 29. 從WhatsApp啓動我的Android應用程序
- 30. 從我的應用程序啓動Android APK文件
我試過這個:\t Intent intent = getPackageManager()。getLaunchIntentForPackage(「com.dropbox.android」);但它不工作! – user1086494
你有DropBox安裝嗎? –
對不起....它是工作!!!我嘗試在沒有Dropbox的其他手機...非常感謝! – user1086494