您的位置:首页 > 产品设计 > UI/UE

锤子手机使用AlertDialog.Builder出现白屏、闪屏问题

2017-11-16 11:18 435 查看
http://blog.csdn.net/shadow066/article/details/46342859
http://blog.csdn.net/devilkin64/article/details/19415717 http://blog.csdn.net/iwuyuetian/article/details/50294985
上面这些都是参考网址:

以前都没有遇到过今天记录一下,万一忘了好回来看下,我用的小米手机一直没有出现问题,看网上资料说是:

加了:

if (!MyApplication.isMIUIRom()){
alterDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);
}


判断是不是小米系统
public static boolean isMIUIRom() {
String property = getSystemProperty("ro.miui.ui.version.name");
return !TextUtils.isEmpty(property);
}
private static String getSystemProperty(String propName) {
String line;
BufferedReader input = null;
try {
Process p = Runtime.getRuntime().exec("getprop " + propName);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
} catch (IOException ex) {
return null;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
}
}
}
return line;
}
但是在锤子手机上又出现问题!
所以最后还是判断手机类型
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: