How to hide animation in DrawableAnimation android -
i have written animation progressdialog . want stop , hide animation when click button. here codes.
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); img = (imageview)findviewbyid(r.id.imageview1); startbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { img.setbackgroundresource(r.drawable.animitems); myanim = (animationdrawable)img.getbackground(); if(videoview.isplaying()){ videoview.pause(); myanim.stop(); myanim.setvisible(false, true); startbutton.setbackgroundresource(r.drawable.andplaybtn); }else{ startbutton.setbackgroundresource(r.drawable.andstopbtn); myanim.start(); videoview.start(); } } });
you see have used drawableanimation class. can't hide animation when started. how this? helps.
Comments
Post a Comment