使用处理程序要定期运行计数为0,如果计数为1,否则请修复此代码。
mRunnable = new Runnable(){
@Override
public void run() {
if (count == 0) {
setImage();
count = 1;
} else {
weather = mContentResolver.getType(mUri);
setWeather(weather);
count = 0;
}
}
};
mHandler = new Handler();
mHandler.postDelayed(mRunnable, 3000);