ChooseContact opens the Contacts app so that the user can select the name and either the phone number or email address of a user.
Example - Choose Phone Number
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
btnChoose = app.CreateButton( "Choose Phone", 0.5, 0.1 );
btnChoose.SetOnTouch( btnChoose_OnTouch );
lay.AddChild( btnChoose );
app.AddLayout( lay );
}
function btnChoose_OnTouch()
{
app.ChooseContact( "phone", OnPhoneChoose );
}
function OnPhoneChoose( name, number )
{
app.ShowPopup( name + " " + number );
}
Example - Choose Email Address
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
btnChoose = app.CreateButton( "Choose Email", 0.5, 0.1 );
btnChoose.SetOnTouch( btnChoose_OnTouch );
lay.AddChild( btnChoose );
app.AddLayout( lay );
}
function btnChoose_OnTouch()
{
app.ChooseContact( "email", OnEmailChoose );
}
function OnEmailChoose( name, email )
{
app.ShowPopup( name + " " + email );
}