两处代码含义的不同处
想问下在3-1章节中有两处“mHandler.postDelayed(new MyRunnable(), 2000);”,请问,分别的含义有什么不同??
class MyRunnable implements Runnable { @Override public void run() { index++; index = index % 4; mImageView.setImageResource(images[index]); mHandler.postDelayed(new MyRunnable(), 2000); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = (TextView) findViewById(R.id.textview); mImageView = (ImageView) findViewById(R.id.imageView); mHandler.postDelayed(new MyRunnable(), 2000);