android - How do I open the LinkedIn app from my app without knowing the profile ID? -
i'm trying apply solution found here, have url of linkedin profile, not id. code ends o
string username = "bill-johnson"; // inferred full url public void tolinkedin(){ intent intent = new intent(intent.action_view, uri.parse("linkedin://" + username)); final packagemanager packagemanager = getpackagemanager(); final list<resolveinfo> list = packagemanager.queryintentactivities(intent, packagemanager.match_default_only); if (list.isempty()) { // fall on full url, know. intent = new intent(intent.action_view, uri.parse(linkedin_url)); } startactivity(intent); }
linkedin's android sdk provides function "deep link" profiles directly within official linkedin app. suggest check out: https://developer.linkedin.com/docs/android-sdk#deeplink
Comments
Post a Comment