簡體   English   中英

使用共享意圖將ANDROID共享到Facebook,Twitter等

[英]ANDROID share to facebook, twitter etc using share intent

我在網上搜索,發現使用共享意圖將此共享共享到Facebook,Twitter或電子郵件。 該共享目的是假設那里有那些facebook,twitter圖標可供選擇嗎? 當我在模擬器中運行時,它不會編寫任何應用程序可以運行此操作。 是共享不能在模擬器中運行,還是我的代碼未完全完成。

下面是我的代碼

btnShare.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
                Intent sharingIntent = new Intent(Intent.ACTION_SEND);
                sharingIntent.setType("plain/text");
                sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,
                        "This is the text that will be shared.");
                startActivity(Intent.createChooser(sharingIntent,
                        "Share via"));
        }
    });

模擬器未安裝可處理共享意圖的Apps。 因此,不會顯示任何應用程序。 如果您手邊沒有Android設備,則可以嘗試將Amazon Appstore或Androidpit市場應用程序下載到模擬器中,並通過該市場安裝共享應用程序。

暫無
暫無

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

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