源码在我的这篇博客里面
http://blog.csdn.net/zhaiguoai/article/details/78608842
在android 4.4-6.0运行时无问题,但是一到7.0以上就是白屏
在度娘和谷哥搜了,解决方法无外乎这两种
http://blog.csdn.net/qwe0754444/article/details/64918868
http://www.jianshu.com/p/07b781795b78
但是我都试过了,没有用,请哪位大神帮帮小弟,谢谢
http://blog.csdn.net/qq_34584049/article/details/78280815
找到原因了,在获取IMEI和pingUrl上
TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
assert tm != null;
@SuppressLint("HardwareIds") String imei = tm.getDeviceId();
删除它不可以正常运行,那么再问一下,请问怎么在android 7.0以上不用上面方法获取IMEI呢?