代码如下:
static Uri PREFERRED_APN_URI = Uri.parse("content://telephony/carriers/preferapn");
ContentResolver cResolver = context.getContentResolver();
Cursor cr = cResolver.query(PREFERRED_APN_URI, null, null, null, null);
cr.moveToFirst();
String user = cr.getString(cr.getColumnIndex("user"));
String pass = cr.getString(cr.getColumnIndex("password"));
//然后对获取的用户名和密码做相关处理获取对应的apn状态
猜你喜欢