我也想保存运算符Name,但我找不到任何合适的标记。任何人请帮助我。
ContentValues values = new ContentValues();
values.put("address", originatingAddress);
values.put("body", sampleContent);
values.put("date", timeStamp);
context.getContentResolver().insert(Uri.parse("content://sms/inbox"), values);
要获取操作员名称,可以使用:
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE));
String OperatorName = manager.getNetworkOperatorName();
然后根据需要在代码中使用它,或者如下所示:
ContentValues values = new ContentValues();
values.put("address", originatingAddress);
values.put("body", sampleContent);
values.put("date", timeStamp);
values.put("body", OperatorName);
context.getContentResolver().insert(Uri.parse("content://sms/inbox"), values);