Java Code Examples for android.content.Intent.ACTION_DIAL

The following are Jave code examples for showing how to use ACTION_DIAL of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: react-native-udesk   File: MessageAdatper.java   View Source Code Vote up 10 votes
@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();
    }

}
 
Example 2
Project: CSipSimple   File: CallLogListFragment.java   View Source Code Vote up 10 votes
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();
    
}
 
Example 3
Project: anyRTC-P2P-Android   File: MainActivity.java   View Source Code Vote up 8 votes
@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;
    }
}
 
Example 4
Project: android-fundamentals-phone-sms   File: MainActivity.java   View Source Code Vote up 8 votes
/**
 * 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.");
    }
}
 
Example 5
Project: nucleus-test   File: UsuarioActivity.java   View Source Code Vote up 8 votes
@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);
    }
}
 
Example 6
Project: Instincts-2k17   File: EventDetailActivity.java   View Source Code Vote up 8 votes
@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;
    }
}
 
Example 7
Project: today-menu-android   File: RestaurantActivity.java   View Source Code Vote up 7 votes
@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);
}
 
Example 8
Project: Farmacias   File: ListTabPresenter.java   View Source Code Vote up 7 votes
@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);

}
 
Example 9
Project: Aurora   File: DeviceUtils.java   View Source Code Vote up 6 votes
public static void openDail(Context context) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}
 
Example 10
Project: mvparms   File: DeviceUtils.java   View Source Code Vote up 6 votes
public static void openDail(Context context) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}
 
Example 11
Project: Pigeon   File: PhoneUtil.java   View Source Code Vote up 6 votes
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);
}
 
Example 12
Project: LJFramework   File: IntentUtils.java   View Source Code Vote up 6 votes
/**
 * 获取跳至拨号界面意图
 *
 * @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);
}
 
Example 13
Project: Appmatic-Android   File: ContactFragment.java   View Source Code Vote up 6 votes
@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)));
}
 
Example 14
Project: SOS-The-Healthcare-Companion   File: HelpDetailActivity.java   View Source Code Vote up 6 votes
@Override
public void onClick(View v) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + "022 2754 6669"));
    startActivity(intent);
    finish();
}
 
Example 15
Project: Review-   File: TDevice.java   View Source Code Vote up 5 votes
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);
}
 
Example 16
Project: android-project-gallery   File: TDevice.java   View Source Code Vote up 5 votes
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);
}
 
Example 17
Project: MVPArms_Fragment-fragment   File: DeviceUtils.java   View Source Code Vote up 3 votes
/**
 * 拨打电话
 *
 * @param context
 * @param number
 */
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);
}
 
Example 18
Project: NeiHanDuanZiTV   File: DeviceUtils.java   View Source Code Vote up 3 votes
/**
 * 拨打电话
 *
 * @param context
 * @param number
 */
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);
}
 
Example 19
Project: yyox   File: DeviceUtils.java   View Source Code Vote up 3 votes
/**
 * 拨打电话
 *
 * @param context
 * @param number
 */
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);
}
 
Example 20
Project: MoligyMvpArms   File: DeviceUtils.java   View Source Code Vote up 3 votes
/**
 * 拨打电话
 *
 * @param context
 * @param number
 */
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);
}