提示用户选择 complete with app for USSD and calls
Prompt user to choose complete with app for USSD and calls
我要存档的是,当用户点击显示为 phone 号码、USSD 代码或能够被拨号器使用的号码时,phone 应该列出用于用户在拨打电话时选择使用哪个应用程序,并让用户选择将来默认使用哪个应用程序。
我是 android 的初学者,我尝试搜索但找不到任何相关问题,我不知道从哪里开始。
另一个问题是onNewIntent
或onActivityResult
上的运算结果
谢谢。
您想使用 implicit intent:
// build intent
Uri number = Uri.parse("tel:5551234"); // replace 5551234 with your number
Intent callIntent = new Intent(Intent.ACTION_DIAL, number);
// Verify it resolves
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(callIntent, 0);
boolean isIntentSafe = activities.size() > 0;
// Start an activity if it's safe
if (isIntentSafe) {
startActivity(callIntent);
}
我要存档的是,当用户点击显示为 phone 号码、USSD 代码或能够被拨号器使用的号码时,phone 应该列出用于用户在拨打电话时选择使用哪个应用程序,并让用户选择将来默认使用哪个应用程序。
我是 android 的初学者,我尝试搜索但找不到任何相关问题,我不知道从哪里开始。
另一个问题是onNewIntent
或onActivityResult
谢谢。
您想使用 implicit intent:
// build intent
Uri number = Uri.parse("tel:5551234"); // replace 5551234 with your number
Intent callIntent = new Intent(Intent.ACTION_DIAL, number);
// Verify it resolves
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(callIntent, 0);
boolean isIntentSafe = activities.size() > 0;
// Start an activity if it's safe
if (isIntentSafe) {
startActivity(callIntent);
}