0

I developed a dial up application and I installed it to my phone. Now I want to "on click a button" in my app to set the built in dialer as the default dialing application "automatically" without giving the user to choose between my app and the default dialer application.

This code gives the user the choice,

startActivityForResult(new Intent("android.intent.action.DIAL",
Uri.parse("tel:" + someNumber)), 1);

I don't want this, I want to set the default application to be built in dialer without asking the user.

Note: Once the user is not using my app he will be given the choice, Howevre, if he clicked that button in my app .. it will set the default app automatically.

4

2 回答 2

0

Try this. This should open default dialer .

Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:0000000000"));
startActivity(i);
于 2013-01-05T11:26:32.750 回答
0

您不能在没有用户交互的情况下强制执行默认活动。你为什么不直接按下按钮给你的班级打电话?

Intent intent = new Intent(this, mydialer.class))
intent.putExtra("PHONENUMBER", _phoneNumber);

startActivityForResult(intent);
于 2013-04-11T14:41:59.390 回答