2016-03-08 18 views
0

我有shareButtonoptionsMenu從哪裏我想通過wasap,gmail發送消息...描述我的應用程序和包含超鏈接到Google Play。分享意圖消息與谷歌播放我的應用程序的超鏈接

的問題是,該超鏈接不會出現,這是我做了什麼:

mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item); 
    Intent sharingIntent = new Intent(Intent.ACTION_SEND); 
    sharingIntent.setType("text/html"); 
    String shareBody = getString(R.string.sharing_intent_text)+"https://www.google.com/"; 
    sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.sharing_intent_subject)); 
    sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody); 
    mShareActionProvider.setShareIntent(sharingIntent); 

這裏是我使用

<string name="sharing_intent_text">Game descrition <a href=https://https://play.google.com/store/apps/details?id=packageName>App Name</a> more description</string> 
<string name="sharing_intent_subject">Subject</string> 

即使我用sharingIntent.setType("text/html")琴絃遊戲名稱不可點擊。

回答

0

我已經解決了這個問題,我需要添加此Html.fromHtml(shareBody)當我把多餘的文字,以傳遞字符串爲HTML格式

sharingIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(shareBody)); 
相關問題