android - progressBar dialog not counting upwards from 0, just appears for a second -



android - progressBar dialog not counting upwards from 0, just appears for a second -

i have progressbar dialog when click button, dialog appears , message appears progress sticks @ 0% , goes next activity instead of going 0%-100% expected. can see i'm going wrong?

package win.jay.todo.list; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.app.progressdialog; import android.view.menu; public class welcome extends activity { private progressdialog progress; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_welcome); progress = new progressdialog(this); } //onclick - go tasks public void dostuff(view view) { intent intent = new intent(welcome.this, tasks.class); startactivity(intent); progress.setmessage("finding tasks..."); progress.setprogressstyle(progressdialog.style_horizontal); progress.setindeterminate(true); progress.show(); final int totalprogresstime = 100; final thread t = new thread(){ @override public void run(){ int jumptime = 5; while(jumptime < totalprogresstime){ seek { thread.sleep(200); jumptime += 5; progress.setprogress(jumptime); } grab (interruptedexception e) { // todo auto-generated grab block e.printstacktrace(); } } } }; t.start(); } @override public boolean oncreateoptionsmenu(menu menu) { //inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu, menu); homecoming true; } }

android onclick progressdialog

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -