android delay using handler -
i want display couple of images , add delay between each image. did , have no errors in code reason app crashes.
bitmap bitmap = bitmapfactory.decodefile(imagein); imageview myimageview = (imageview)findviewbyid(r.id.imageview); myimageview.setimagebitmap(bitmap); // 2 lines used make handler handler handlertimer = new handler(); handlertimer.postdelayed((runnable) this, 20000);
you don't class hosts snippet posted, think handlertimer.postdelayed((runnable) this, 20000); unlikely right.
try adding anonymous runnable object such as
handlertimer.postdelayed(new runnable(){ public void run() { // }}, 20000); another thing, logcat output invaluable getting clues causing crash. http://developer.android.com/guide/developing/tools/logcat.html
Comments
Post a Comment