using System;
|
using Android.Content;
|
|
namespace Shared
|
{
|
public static class Contacts
|
{
|
public static Action<string,string> ContactAction;
|
public static void Open()
|
{
|
(Shared.Application.Activity as BaseActivity).SetContactsPermission((b) => {
|
if (b)
|
{
|
// 跳转到联系人界面
|
var intent = new Intent();
|
intent.SetAction("android.intent.action.PICK");
|
intent.AddCategory("android.intent.category.DEFAULT");
|
intent.SetType("vnd.android.cursor.dir/phone_v2");
|
Shared.Application.Activity.StartActivityForResult(intent, 0x30);
|
}
|
else {
|
ContactAction?.Invoke(null, null);
|
}
|
});
|
}
|
}
|
}
|