當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.ACTION_DIAL屬性代碼示例

本文整理匯總了Java中android.content.Intent.ACTION_DIAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Intent.ACTION_DIAL屬性的具體用法?Java Intent.ACTION_DIAL怎麽用?Java Intent.ACTION_DIAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_DIAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

@Override
public void onClick(View view) {
    try {
        if (mStructBtn.getType().equals(UdeskConst.StructBtnTypeString.link)) {
            Intent intent = new Intent(mContext, UdeskWebViewUrlAcivity.class);
            intent.putExtra(UdeskConst.WELCOME_URL, mStructBtn.getValue());
            mContext.startActivity(intent);
        } else if (mStructBtn.getType().equals(UdeskConst.StructBtnTypeString.phone)) {
            Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + mStructBtn.getValue()));
            mContext.startActivity(dialIntent);
        } else if (mStructBtn.getType().equals(UdeskConst.StructBtnTypeString.sdkCallBack)) {
            if (UdeskSDKManager.getInstance().getStructMessageCallBack() != null) {
                UdeskSDKManager.getInstance().getStructMessageCallBack().structMsgCallBack(mContext, mStructBtn.getValue());
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

}
 
開發者ID:lennyup,項目名稱:react-native-udesk,代碼行數:20,代碼來源:MessageAdatper.java

示例2: actionModeDialpad

private void actionModeDialpad() {
    
    ListView lv = getListView();

    for(int i = 0; i < lv.getCount(); i++) {
        if(lv.isItemChecked(i)) {
            mAdapter.getItem(i);
            String number = mAdapter.getCallRemoteAtPostion(i);
            if(!TextUtils.isEmpty(number)) {
                Intent it = new Intent(Intent.ACTION_DIAL);
                it.setData(SipUri.forgeSipUri(SipManager.PROTOCOL_SIP, number));
                startActivity(it);
            }
            break;
        }
    }
    mMode.invalidate();
    
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:CallLogListFragment.java

示例3: onClick

@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.tv_go_pre:
            if (!TextUtils.isEmpty(mUserid)) {
                startAnimActivity(PreCallActivity.class);
                return;
            }
            if (TextUtils.isEmpty(etId.getText().toString().trim())){
                Toast.makeText(this,"請輸入手機號",Toast.LENGTH_SHORT).show();
                return;
            }
            mUserid=etId.getText().toString().trim();
            SharePrefUtil.putString("userid",mUserid);
            mP2PKit.turnOn(mUserid);
            startAnimActivity(PreCallActivity.class);
            break;
        case R.id.tv_call:
            Uri uri = Uri.parse("tel:021-65650071");
            Intent intent = new Intent(Intent.ACTION_DIAL, uri);
            startActivity(intent);
            break;
    }
}
 
開發者ID:AnyRTC,項目名稱:anyRTC-P2P-Android,代碼行數:24,代碼來源:MainActivity.java

示例4: dialNumber

/**
 * Uses an implicit intent to dial the phone with the Phone app.
 * Gets the phone number from TextView number_to_call.
 *
 * @param view View (phone_icon) that was clicked.
 */
public void dialNumber(View view) {
    TextView textView = (TextView) findViewById(R.id.number_to_call);
    // Use format with "tel:" and phone number to create phoneNumber.
    String phoneNumber = String.format("tel: %s", textView.getText().toString());
    // Create the intent.
    Intent dialIntent = new Intent(Intent.ACTION_DIAL);
    // Set the data for the intent as the phone number.
    dialIntent.setData(Uri.parse(phoneNumber));
    // If package resolves to an app, send intent.
    if (dialIntent.resolveActivity(getPackageManager()) != null) {
        startActivity(dialIntent);
    } else {
        Log.e(TAG, "Can't resolve app for ACTION_DIAL Intent.");
    }
}
 
開發者ID:google-developer-training,項目名稱:android-fundamentals-phone-sms,代碼行數:21,代碼來源:MainActivity.java

示例5: onCreateContextMenu

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    if (v == telefone) {
        Intent vaiParaTelaDeDiscagem = new Intent(Intent.ACTION_DIAL);
        Uri userTelefone = Uri.parse("tel:" + Singleton.getInstance().currentUser.getPhone());
        vaiParaTelaDeDiscagem.setData(userTelefone);
        startActivity(vaiParaTelaDeDiscagem);
    }
    else if (v == website){
        if (Singleton.getInstance().currentUser.getUrl() != null && Singleton.getInstance().currentUser.getUrl() != ""){
            Intent vaiParaWebsite = new Intent(Intent.ACTION_VIEW);
            Uri userWebsite = Uri.parse("http://" + Singleton.getInstance().currentUser.getUrl());
            vaiParaWebsite.setData(userWebsite);
            startActivity(vaiParaWebsite);
        }

    }
    else if (v == email){
            Intent vaiParaEmail = new Intent(Intent.ACTION_SENDTO);
            Uri userEmail = Uri.parse("mailto:" + Singleton.getInstance().currentUser.getEmail());
            vaiParaEmail.setData(userEmail);
            startActivity(vaiParaEmail);
    }
}
 
開發者ID:robsonribeiroft,項目名稱:nucleus-test,代碼行數:24,代碼來源:UsuarioActivity.java

示例6: onActionClick

@Override
protected void onActionClick(View action) {
    super.onActionClick(action);
    CardView cardView = (CardView) action;
    RelativeLayout relativeLayout = (RelativeLayout) cardView.getChildAt(0);
    ImageView imageView = (ImageView) relativeLayout.getChildAt(0);
    switch ((int) imageView.getTag()) {
        case R.drawable.ic_call:
            Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" +
                    event.getContact1().split(":")[1]));
            startActivity(intent);
            break;

        case R.drawable.ic_map:
            startActivity(new Intent(EventDetailActivity.this, MapsActivity.class)
                    .putExtra("location", event.getLocation()));
            break;
    }
}
 
開發者ID:adithya321,項目名稱:Instincts-2k17,代碼行數:19,代碼來源:EventDetailActivity.java

示例7: onOptionsItemSelected

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.action_call && mRestaurant.mPhone != null) {
        Intent intent = new Intent(Intent.ACTION_DIAL);
        intent.setData(Uri.parse("tel:" + mRestaurant.mPhone));
        startActivity(intent);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
開發者ID:boldijar,項目名稱:today-menu-android,代碼行數:10,代碼來源:RestaurantActivity.java

示例8: handleClickCall

@Override
public void handleClickCall(String phone) {
    String uri = "tel:" + phone;
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setData(Uri.parse(uri));
    mView.launchActivity(intent);

}
 
開發者ID:cahergil,項目名稱:Farmacias,代碼行數:8,代碼來源:ListTabPresenter.java

示例9: openDail

public static void openDail(Context context) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}
 
開發者ID:Zweihui,項目名稱:Aurora,代碼行數:5,代碼來源:DeviceUtils.java

示例10: callTo

public static void callTo(Context context, String number) {
    Uri uri = Uri.parse("tel:" + number);
    Intent it = new Intent(Intent.ACTION_DIAL, uri);
    context.startActivity(it);
}
 
開發者ID:monsterLin,項目名稱:Pigeon,代碼行數:5,代碼來源:PhoneUtil.java

示例11: getDialIntent

/**
 * 獲取跳至撥號界麵意圖
 *
 * @param phoneNumber 電話號碼
 */
public static Intent getDialIntent(String phoneNumber) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri
            .parse("tel:" + phoneNumber));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
開發者ID:imliujun,項目名稱:LJFramework,代碼行數:10,代碼來源:IntentUtils.java

示例12: performPhoneCall

@Override
public void performPhoneCall() {
    Uri call = Uri.parse("tel:" + contact.getContact_phone());
    Intent intent = new Intent(Intent.ACTION_DIAL, call);
    startActivity(Intent.createChooser(intent, getString(R.string.call_with)));
}
 
開發者ID:Nulltilus,項目名稱:Appmatic-Android,代碼行數:6,代碼來源:ContactFragment.java

示例13: onClick

@Override
public void onClick(View v) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + "022 2754 6669"));
    startActivity(intent);
    finish();
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:6,代碼來源:HelpDetailActivity.java

示例14: openDial

public static void openDial(Context context, String number) {
    Uri uri = Uri.parse("tel:" + number);
    Intent it = new Intent(Intent.ACTION_DIAL, uri);
    context.startActivity(it);
}
 
開發者ID:FallenCrood,項目名稱:Review-,代碼行數:5,代碼來源:TDevice.java

示例15: openDial

public static void openDial(Context context, String number)
{
	Uri uri = Uri.parse("tel:" + number);
	Intent it = new Intent(Intent.ACTION_DIAL, uri);
	context.startActivity(it);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:6,代碼來源:TDevice.java


注:本文中的android.content.Intent.ACTION_DIAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。