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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -