为什么要这样做
HorizontalScrollView hsv = (HorizontalScrollView) findViewById(R.id.buttons);
if (null != hsv) hsv.scrollBy(iLengthToScroll, 0);
onResume中的什么都不做,但是
Handler mHandler = new Handler();
Runnable scroll = new Runnable()
{
@Override
public void run()
{
HorizontalScrollView hsv = (HorizontalScrollView) findViewById(R.id.buttons);
if (null != hsv) hsv.scrollBy(iLengthToScroll, 0);
}
};
mHandler.post(scroll);
滚动吗? Handler.post将runnable添加到UI线程,但onResume已经在UI线程中了,不是吗?