android - Start Activity on a thread -
I have splash activity and when the progress thumbs up to its maximum value, Want to start My problem is that I do not know that I have an error on IF statement to find out the initial intentions.
new thread (new runlevel) {public run zero () (while progress status <100) {progressStatus + = 5;} if (progressStatus == progressBar.getMax ()) { Intent = new intent (". Menu"); startActivity;} // update the progress bar and display the current value in the text: see handler.post (new runnab) {public zero run ()} { ProgressBar.set progress (progress status); textView.setText (progress status + "/" + progressBar.getMax ());}}), try {// 200 milliseconds for sleep. // just progress progressivelyThread.Sleep for (200);} Hold (Interrupted E) e.printStackTrace ();}}}). Manifest :
& lt; Activity Android: name = "NewMainActivity" android: label = "@ string / app_name" Android: Screen Orientation = "Portrait" & gt; & Lt; Intent-Filter & gt; & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; Action Android: name = ". MENU" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; My Splash Activity is main activity cell then NewMenctivity class is another activity.
While trying to loop this way
new Thread (New Runnabal) {@Override Run Public Zero () {While (Pragmatic Location & Lt; 100) {progressStatus + = 5; // Update the progress bar and display the current value in the text view handler (new runlevel) {@Override Public runs zero () {ProgressBar.setProgress (progress status); TextView.setText (progress status + "/" + progressBar.getMax ());}}) {// sleep for 200 milliseconds. // Simply Thread.sleep (200) to display progress; If (Pragti space == 100) {intent i ntent = new intent ("." "Menu"); StartActivity; }} Grip (Interrupted e) e.printStackTrace (); }} // while loop} // run ()}) Start (); Then enter your status under thread.sleep .
Comments
Post a Comment