//解決切換別的應(yīng)用碧浊,返回此應(yīng)用王带,重新啟動的問題
在splash onCreate 添加
if (!isTaskRoot()) {
finish();
return;
}
/**
- 設(shè)置使用小米手機劉海屏區(qū)域
*/
private void setMIUINotch() {
int flag = 0x00000100 | 0x00000200 | 0x00000400;
try {
Method method = Window.class.getMethod("addExtraFlags", int.class);
method.invoke(getWindow(), flag);
} catch (Exception e) {
Log.i("launch", "addExtraFlags not found.");
}
}