Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

 1 Answer(s)

  • Create a check for the facebook before sharing the data following is an example

     public void shareIntent(){
            String urlToShare = "";
            Intent intent = new Intent(Intent.ACTION_SEND);
    // intent.putExtra(Intent.EXTRA_SUBJECT, "Foo bar"); // NB: has no effect!
            intent.putExtra(Intent.EXTRA_TEXT, urlToShare);
    // See if official Facebook app is found
            boolean facebookAppFound = false;
            List matches = act.getPackageManager().queryIntentActivities(intent, 0);
            for (ResolveInfo info : matches) {
                if (info.activityInfo.packageName.toLowerCase().startsWith("com.facebook.katana")) {
                    facebookAppFound = true;
    // As fallback, launch sharer.php in a browser
            if (!facebookAppFound) {
                String sharerUrl = "" + urlToShare;
                intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sharerUrl));
Sign In

Sign up using

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: