Skip to content

Instantly share code, notes, and snippets.

@appcoreopc
Created March 24, 2016 04:34
Show Gist options
  • Save appcoreopc/df7adba152518407fd48 to your computer and use it in GitHub Desktop.
Save appcoreopc/df7adba152518407fd48 to your computer and use it in GitHub Desktop.
public class AddCustomerInterfacing : Java.Lang.Object, Java.Lang.IRunnable
{
private Context context;
private Activity _activity;
public const int RQS_PICK_CONTACT = 1;
public AddCustomerInterfacing(Context context, Activity activity)
{
this.context = context;
_activity = activity;
}
// Android API 17 and above
[Export]
[JavascriptInterface]
public void addCustomer()
{
var contactIntent = new ContactUtil().CreatePhoneLookupIntent();
_activity.StartActivityForResult(contactIntent, RQS_PICK_CONTACT);
}
/// <summary>
/// Add support for API 16 below
/// </summary>
public void Run()
{
addCustomer();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment