Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • How to Share App Url in Linkedin in android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 651
    Comment on it

    In the below example code I have clearly described,how you can share your app page url used by Intent in Linkedin.Here I have used putExtra method to add url.And I have also used  activity info and package name .

     private void shareOnlinkedin() {
             Intent linkedinIntent = new Intent(Intent.ACTION_SEND);
             linkedinIntent.setType("text/plain");
    
             linkedinIntent.putExtra(Intent.EXTRA_TEXT, referralUrl); //here I have added app page url .
    
            boolean linkedinAppFound = false;     //check app insall in your phone .
            List<ResolveInfo> matches2 = getActivity().getPackageManager()
                    .queryIntentActivities(linkedinIntent, 0);
    
            for (ResolveInfo info : matches2) {
                if (info.activityInfo.packageName.toLowerCase().startsWith(  //added packageName & className
                        "com.linkedin")) {
                    linkedinIntent.setPackage(info.activityInfo.packageName);
                    linkedinAppFound = true;
                    break;
                }
            }
    
            if (linkedinAppFound) {              
                startActivity(linkedinIntent);
    
            }
            else
            {
                Toast.makeText(getContext(),"LinkedIn app not Insatlled in your mobile",Toast.LENGTH_LONG).show();
    
            }
            }
    
    

     

    Android intent linkedin share

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: