Example usage for android.webkit WebView SCHEME_TEL

List of usage examples for android.webkit WebView SCHEME_TEL

Introduction

In this page you can find the example usage for android.webkit WebView SCHEME_TEL.

Prototype

String SCHEME_TEL

To view the source code for android.webkit WebView SCHEME_TEL.

Click Source Link

Document

URI scheme for telephone number.

Usage

From source file:com.polyvi.xface.extension.XTelephonyExt.java

/**
 * ???// w ww.  j  a va2 s  .  c o  m
 *
 * @param[in] phoneNumber ????
 * @return ???
 * */
private boolean initiateVoiceCall(String phoneNumber) {
    try {
        if (isLegalPhoneNum(phoneNumber)) {
            Intent intent = new Intent(Intent.ACTION_CALL);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setData(Uri.parse(WebView.SCHEME_TEL + phoneNumber));
            getContext().startActivity(intent);
            return true;
        }
    } catch (ActivityNotFoundException e) {
        XLog.e(CLASS_NAME, e.toString());
    } catch (SecurityException e) {
        XLog.e(CLASS_NAME, e.toString());
    }
    return false;
}