点击跳转到其他页面正常显示dialog:
try {
Field field = dialog.getClass().getSuperclass().getDeclaredField( "mShowing");
field.setAccessible(true);
field.set(dialog, false);
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
手动关闭dialog:
try {
Field field = dialog.getClass().getSuperclass().getDeclaredField( "mShowing");
field.setAccessible(true);
field.set(dialog, true);
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}