2
我必须为我的公司开发一个适用于Android的拨号器应用程序,以利用我们的内部voip系统。我对android完全陌生,但有钛的经验。查看Android拨号器中的号码
该应用程序应该捕获该号码并且必须对号码执行一定的检查。在检查标准电话应用程序应该拨打该号码后。
注册一个BroadcastReceiver是不是一种选择,因为这一活动已经开始对用户的输入/
决定对于这种情况,我有以下表现:
<activity android:name="CallerActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/phone_v2" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
</application>
如预期那样工作。我的应用程序显示为拨号选项。然后在我的活动我有以下代码:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent i = getIntent();
final Uri number = i.getData();
number = checkNumberInternal(number);
Intent dial = new Intent(Intent.ACTION_CALL, number);
dial.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dial);
}
的代码实际工作,但唯一的问题是,默认的拨号选项对话框连连弹出。
该应用程序必须没有任何UI
我确实有这个在未经许可的manifest文件中设定。奇怪的是应用程序在代码启动拨号活动时自动调用“自身” – ak77