I am developing an android application in which I want to share my data through WhatsApp and hike(to my friends in phone contact) or mail to my friends.
Can someone please explain me with lines of codes...
Like most social Android apps, WhatsApp listens to intents to share media and text. Simply create an intent to share text, for example :
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); sendIntent.setType("text/plain"); sendIntent.setPackage("com.whatsapp"); startActivity(sendIntent);