0

I have a button "Share on Facebook".

shareButton.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {

                }
            });

By clicking it, how I can share app's Play Market link to Facebook if I have Facebook SDK attached?

Hayk Abelyan
  • 326
  • 2
  • 3
  • 19

1 Answers1

1
public void sendShareFacebook(String strShareMessage) 
{
        Intent mIntent = new Intent(Intent.ACTION_SEND);
        mIntent.setType("text/plain");
        mIntent.setPackage("com.facebook.katana");
        mIntent.putExtra(Intent.EXTRA_TEXT, strShareMessage);
        try {
            mContext.startActivity(mIntent);
        } catch (android.content.ActivityNotFoundException ex) {
            Utility.toastShort(mContext, "Facebook not installed");
        }
    }
Coldfin Lab
  • 361
  • 3
  • 8