Using a neat little feature you can make your app social using 5 lines of code.
The idea is to launch an intent of type ACTION_SEND which will pop up an Android dialog box for sharing. Every activity that binds itself to this activity will be displayed. Usually activities that have sharing capabilities (like Linkedin, Twitter and Facebook) will show up in that list.
Use the following code:
Intent intent=new Intent(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, "Subject"); intent.putExtra(Intent.EXTRA_TEXT, "Description"); activity.startActivity(Intent.createChooser(intent, "Dialog caption"));
Ain’t that simple ?
In case you want specific activities to handle your request then make sure to change the type, usually most social apps will listen to text/plain.