First set the on click listener for your Button :
Then Call this function !!!!
private void call(String phone) {
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+phone));
startActivity(callIntent);
} catch (ActivityNotFoundException e)
}
And Bingo thats IT!!!
btnMail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0)
{
// TODO Auto-generated method stub
call(txtPhone.getText().toString());
}
});
@Override
public void onClick(View arg0)
{
// TODO Auto-generated method stub
call(txtPhone.getText().toString());
}
});
Then Call this function !!!!
private void call(String phone) {
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+phone));
startActivity(callIntent);
} catch (ActivityNotFoundException e)
}
And Bingo thats IT!!!
No comments:
Post a Comment