Sub Process_Globals
Private nativeMe As JavaObject
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("x")
If FirstTime Then
nativeMe.InitializeContext
End If
'nativeMe.runMethod("wts",Array(nativeMe))
End Sub
#If JAVA
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.content.DialogInterface;
import android.app.Activity;
import android.database.Cursor;
import android.provider.ContactsContract;
import android.content.pm.PackageManager;
public void wts()
{
Intent i = new Intent(Intent.ACTION_SENDTO, Uri.parse("content://com.android.contacts/data/+xxxxxxxx" ));
i.setPackage("com.whatsapp"); // so that only Whatsapp reacts and not the chooser
i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
i.putExtra(Intent.EXTRA_TEXT, "I'm the body.");
startActivity(i);
#end if
Sub Button1_Down
nativeMe.runMethod("wts",Null)
End Sub