2017-03-03 115 views
0

這是簡單的HTML頁面,我的代碼如下。如何在公司頁面打開Linkedin App?

<a href="linkedin://company/[linkedIncomapanyID]">LinkedIn</a> 

點擊在設備打開LinkedIn應用程序,並打開公司網頁上面的鏈接。這在iOS設備上工作正常,但不適用於Android設備。有沒有解決方案的Android設備?在此先感謝

+0

當您點擊Android設備中的鏈接時發生了什麼? – WoookLiu

+0

只需打開LinkedIn應用程序。未打開特定的「linkedIncomapanyID」公司頁面。但在iPhone應用程序打開公司(linkedIncomapanyID)頁面。 –

+0

這可能是有用的http://stackoverflow.com/questions/24926588/could-not-open-linkedin-app-with-company-profile-url-by-another-android-app – Toxide82

回答

0

這是解決方案。如果用戶擁有LinkedIn應用程序,則應用程序將啓動,否則公司配置文件將顯示在瀏覽器中。

String pageId = "your-company-id"; 
final String urlFb = "linkedin://" + pageId; 
Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setData(Uri.parse(urlFb)); 



final PackageManager packageManager = this.getPackageManager(); 
List<ResolveInfo> list = packageManager.queryIntentActivities(intent, 
     PackageManager.MATCH_DEFAULT_ONLY); 

if (list.size() == 0) { 
    final String urlBrowser = "http://www.linkedin.com/company/" + pageId; 
    intent.setData(Uri.parse(urlBrowser)); 
} 
this.startActivity(intent); 
0

我已經加入 <a href="https://www.linkedin.com/company/[companylinkedinURL]">LinkedIn</a>

如果應用程序不是開放,提供鏈接並重定向到公司的網頁。 在Android設備上正常工作。