代码语言:javascript复制
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
View rootview = getWindow().getDecorView();
View focusView = rootview.findFocus();
Log.i("Zachary", "===当前获取焦点的View===" focusView.toString());
}
}
}).start();