Created
March 24, 2016 04:34
-
-
Save appcoreopc/df7adba152518407fd48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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