Android Question translate to b4a ContactsContract code

Fabio vega

Member
Licensed User
code java:
   Intent intent = new Intent(Intent.ACTION_INSERT);
    intent.setType(ContactsContract.Contacts.CONTENT_TYPE);

    intent.putExtra(ContactsContract.Intents.Insert.NAME, "Name");
    intent.putExtra(ContactsContract.Intents.Insert.PHONE, "telephone");
    intent.putExtra(ContactsContract.Intents.Insert.EMAIL, "email");


Hello the correct code for us is:
B4X:
Dim i As Intent
    i.Initialize("android.intent.action.INSERT","")
    i.setType( "vnd.android.cursor.dir/contact")
    i.Flags=1
    i.PutExtra("name", "some Contact Name")
    i.PutExtra("phone","12121212")
    i.PutExtra("email","[email protected]")
    i.PutExtra("postal","Mz 60 casa 9A")
    i.PutExtra("job_title","engineer")
StartActivity(i)
 
Last edited:
Top