Android アプリケーションから電話をかけていますが、電話をかけることができる一連のアプリがリストされており、ユーザーは電話をかけるアプリを選択できます。しかし、私が知りたいのは、電話をかけることができるすべてのアプリ**をリストする代わりに、特定のサードパーティの VOIP アプリ (Cisco Jabber など)に通話をリダイレクトする方法はありますか? 使ってみました
ブロードキャストレシーバーを使用して発信通話を中断するように登録しACTION_NEW_OUT_GOING_CALLS
ますが、次のブロードキャストレシーバーのコードをリダイレクトする方法がわかりません。
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
Log.d("Test", ""+phoneNumber);
TelephonyManager telephoneManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class<?> c = telephoneManager.getClass();
Class className = Class.forName(c.getName());
Log.d("Test", c.getSimpleName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
List<ResolveInfo> callAppList = context.getPackageManager().queryIntentActivities(intent, 0);
Log.d("Test", ""+callAppList.size());
if(callAppList.size() > 0)
Log.d("Test", callAppList.get(0).activityInfo.targetActivity);
}