今天项目中为了实现将点击事件扩大到整行,对整行调用控件的performClick方法,但是不管用...网上查了,有人说是必须在UI线程执行
View.post(new Runnable(){
@Override
public void run() {
button.performClick();
}
});
Activity.runOnUiThread(new Runnable() {
@Override
public void run() {
button.performClick();
}
});
试了这俩方法,都没用,见鬼了
试着给view.post加了delay,1000有效,100无效,300无效,500有效,不知道神马原因,记下来有空再研究一下