当前位置: 首页>>代码示例>>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;未经允许,请勿转载。