本文整理匯總了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();
}
}
示例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();
}
示例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;
}
}
示例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.");
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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)));
}
示例13: onClick
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + "022 2754 6669"));
startActivity(intent);
finish();
}
示例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);
}
示例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);
}