2017-09-01 43 views
0

我目前正在为网站上的Linkedin提供分享按钮。一切正常,只是当我试图把它分享给个别人(Share to individual people screenshot)与共享网址(https://www.linkedin.com/shareArticle?mini=true & URL = MYURL),他们通过看它 android应用程序。在android上,消息“我认为你可能对 感兴趣”在消息框中显示,但没有链接到该网站。我 也试图做共享链接发生器(https://developer.linkedin.com/plugins/share)相同,看看我是否产生了一个错误的链接,但这会导致相同的问题。我已经测试了IOS应用程序,并且链接确实显示并工作。是否有其他人有相同的问题,并知道发生了什么问题以及如何解决?提前致谢。当在LinkedIn上分享网站或个人链接时,链接不会显示在Linkedin Android应用程序

+1

份额问题 –

+0

你的代码我使用自定义的URL像https://www.linkedin.com/shareArticle?mini=true&url=MYURL为纽带,以分享网页。 (文档:https://developer.linkedin.com/docs/share-on-linkedin) – MBE

回答

0

你可以试试这个

Intent linkedinIntent = new Intent(Intent.ACTION_SEND); 
linkedinIntent.putExtra(Intent.EXTRA_TEXT, edinputText.getText().toString().trim()); 
linkedinIntent.setType("text/plain"); 

boolean linkedinAppFound = false; 
List<ResolveInfo> matches2 = this.getPackageManager() 
         .queryIntentActivities(linkedinIntent, 0); 

for (ResolveInfo info : matches2) { 
    if (info.activityInfo.packageName.toLowerCase().startsWith(
          "com.linkedin")) { 
    linkedinIntent.setPackage(info.activityInfo.packageName); 
    linkedinAppFound = true; 
         break; 
        } 
     } 
    if (linkedinAppFound) { 
      startActivity(linkedinIntent); 
     } else { 

      Toast.makeText(MainActivity.this, "Please install the LinkedIn app to share your result", Toast.LENGTH_LONG).show(); 
    } 
相关问题