簡體   English   中英

共享意圖僅顯示消息傳遞和藍牙應用程序。 我該如何分享更多選項/應用程序?

[英]Share intent is showing only messaging & bluetooth app. How can I have more options/apps to share with?

我想在我的應用程序中添加共享功能。

我想分享我的應用程序的鏈接。

到目前為止,這是我所做的:

LinearLayout linearLayoutShareAppContainer = (LinearLayout) findViewById(R.id.share_app_container);
        linearLayoutShareAppContainer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final Handler handler3 = new Handler();
                handler3.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
                        sharingIntent.setType("text/plain");
                        String shareBody = "Here is the share content body";
                        sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
                        startActivity(Intent.createChooser(sharingIntent, "Share via..."));
                    }
                }, 200);
            }
        });

問題在於,單擊共享文本(布局)時,僅顯示了與藍牙和消息傳遞應用程序共享的內容。

我想要擁有更多與WhatsApp,Facebook,Twitter等共享的應用程序。

因為我是初學者,所以我不知道該怎么辦!

請讓我們知道。

謝謝。

與我在這里遇到的問題相同: Android:在與外部應用共享文本類型數據時跳過了選擇器對話框

  1. 您的設備中沒有其他合適的應用,或者
  2. 您必須清除/恢復默認的應用程序設置(例如,“電話設置”>“管理應用程序”>“重置應用程序首選項”)

您可以使用

startActivity(Intent.createChooser(sendIntent, "choose one"));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM