当有gsm卡和cdma卡在手机中时,即使选择使用gsm上网。通过//方式一
private String getSimOperator() {
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String SimOperator = tm.getSimOperator();
return SimOperator;
}
//方式二
public ApnNode getDefaultAPN() {
String id = "";
String apn = "";
String proxy = "";
String name = "";
String port = "";
String type = "";
String mcc = "";
String mnc = "";
String numeric = "";
ApnNode apnNode = new ApnNode();
Uri uri = Uri.parse("content://telephony/carriers");
Cursor cr = getContentResolver().query(uri, null, null, null, null);
String apnTemp = "";
while (cr != null && cr.moveToNext()) {
// APN id
int i = cr.getColumnIndex("current");
if (cr.getString(i) != null) {
apnTemp = cr.getString(i); if (apnTemp.equals("1")) {
id = cr.getString(cr.getColumnIndex("_id"));
name = cr.getString(cr.getColumnIndex("name"));
apn = cr.getString(cr.getColumnIndex("apn")).toLowerCase();
proxy = cr.getString(cr.getColumnIndex("proxy"));
port = cr.getString(cr.getColumnIndex("port"));
mcc = cr.getString(cr.getColumnIndex("mcc"));
mnc = cr.getString(cr.getColumnIndex("mnc"));
numeric = cr.getString(cr.getColumnIndex("numeric"));
type = cr.getColumnName(cr.getColumnIndex("type"));
}
} // do other things...
} // phoneSettedApnID = Integer.valueOf(id);
apnNode.setName(name);
apnNode.setApn(apn);
apnNode.setProxy(proxy);
apnNode.setPort(port);
apnNode.setMcc(mcc);
apnNode.setMnc(mnc);
apnNode.setNumeric(numeric);
apnNode.setType(type);
return apnNode;
}

得到的都是cdma卡的信息。而我现在选择了gsm啊!!
如何才能获取gsm的sim信息呢(假设我以及我gsm的apn都删除了,所以不能通过遍历数据库content://telephony/carriers的current字段来判断)