2

I want to share my android application link on simple button click to facebook as well as twitter. basically I want to share some custom text and my application link of market.

So what i have to do to achieve this?

Any suggestion will be appreciated.

Rushabh Patel
  • 3,052
  • 4
  • 26
  • 58
  • who gave -1...any thing wrong i have told buddy? – Rushabh Patel Sep 09 '12 at 18:14
  • 1
    That you will never know. And as to why, it is possibly because you are asking a question already asked and answered several times on SO. And plus you have not shown any effort to do it yourself other than having typed a few lines asking for a ready-made solution. Show what you have tried and ask specific questions if you are stuck. – Siddharth Lele Sep 09 '12 at 18:19
  • @TwistedUmbrella: I would love to have done just that. And I was about to when before I could copy the link back, you had already posted the same one. Made my post moot. Plus, the OP has to show some effort on his part too. That's my opinion. You might have a different one. – Siddharth Lele Sep 09 '12 at 18:28
  • 1
    @Sid : yes i understand you and also i have used Facebook sdk and made actually but just to share only a single link, i want to ask that is there any other way to do so. that is only my requirement. So i put this question to find other option also. – Rushabh Patel Sep 10 '12 at 05:38

3 Answers3

1
String message = "Text I want to share."
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_TEXT, message);

startActivity(Intent.createChooser(share, "Title of the dialog the system will open"));

As documented in the answer found at Android - Share on Facebook, Twitter, Mail, ecc

Community
  • 1
  • 1
Abandoned Cart
  • 4,512
  • 1
  • 34
  • 41
1
btnShare = (Button)findViewById(R.id.btnShare);
    btnShare.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plan");
            String sharBody = "Body";
            String shareSub = "Subject";
            intent.putExtra(Intent.EXTRA_SUBJECT,shareSub);
            intent.putExtra(Intent.EXTRA_TEXT,shareSub);
            startActivity(intent.createChooser(intent,"Share Using"));           }
    });
}

Add your custom things in Subject.

0

Solution

1.I f you wan to share you application link from your android application to facebook, twitter and any other social media.

  1. So you want to follow these library
    implementation 'com.github.premsingh8171:updateappOnplayStore:1.0.0'
repositories {
            
          maven { url 'https://jitpack.io' 
}
  1. There are three method available for App rating, share app any other social media and Update app version.

More details follow link: https://github.com/premsingh8171/updateappOnplayStore