![](/img/trans.png)
[英]Launching app from Android Notification Bar. How to start a fresh instance of application rather than resume background process?
[英]Android share action. Trigger from navigation drawer rather than top bar.
我的應用程序有一個導航抽屜,作為其左側的選項之一,我希望它具有“與朋友共享”的功能。 用戶可以點擊與朋友共享菜單選項,並將觸發Android本機共享操作。 可能嗎? 您可以與我共享教程上的鏈接或代碼示例,以了解如何從其他地方(例如左側菜單)而不是頂部欄觸發Android共享操作。
謝謝!
你可以這樣做:
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_TEXT, "message to share");
startActivity(Intent.createChooser(share, "title"));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.