如何在Android中获得双卡的电信提供商名称

时间:2016-10-20 11:45:56

标签: android telephonymanager

$project_name = 'OCT16: Some Project';
$project_name = preg_replace("/\b[A-Z]{3,4}\d{2}:\s?/u", "", $project_name);

print_r($project_name);  // "Some Project"

// another test case:
$project_name = ' Some Project OCT16: some text';
....
print_r($project_name);  // "Some Project some text"

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

TelephonyManager telephonyManager =((TelephonyManager) Context.getSystemService(Context.TELEPHONY_SERVICE));
String operatorName = telephonyManager.getSimOperatorName();

您可以阅读更多here。 我希望能解决这个问题。祝你有愉快的一天!