重写onWindowFocusChanged方法
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// TODO Auto-generated method stub
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
//避免重复调用
}
}
当Activity获取焦点和失去焦点时都会调用该方法,
时间: 2024-10-13 23:08:15