Ritesh Mathur Ritesh Mathur - 1 year ago 85
Android Question

How to invoke email ,message box, whtasapp using intent filter

I am using intent filter i.e ACTION_SEND for invoking email,message box, whtasapp
and i want to fix some elements like if user click on message box at that time mobile number come automatically which i have set and when user select email then receiver mail id come automatically
I made a code for email but wouldn't getting number in message box
I am writing my code here

smsbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
intent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"xyz@gmail.com"});

//Intent receiver = new Intent(getApplicationContext(), ShareActivity.class);
//receiver.putExtra("test", "test");
// PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, receiver, PendingIntent.FLAG_UPDATE_CURRENT);
Intent chooser = Intent.createChooser(intent, "Share");

<!-- This activity handles "SEND" actions with text data -->
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain" />
<data android:scheme="tel" />
<!-- This activity also handles "SEND" and "SEND_MULTIPLE" with media data -->


Answer Source
     Intent sendIntent = new Intent(Intent.ACTION_VIEW);
     sendIntent.putExtra("address", mobile no here);

Please try the above codes to pass mobile no.