Back to project page interamap.
The source code is released under:
MIT License
If you think the Android project interamap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.richso.interamap; /*from ww w .ja v a 2 s. c om*/ import android.app.Activity; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.widget.ProgressBar; import com.richso.interamap.utils.L; public class SplashScreen extends Activity { private static final int TIMER_RUNTIME = 5000; private ProgressBar progressBar; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); init(); (new LogoTask()).execute(); } private void init() { progressBar = (ProgressBar)findViewById(R.id.progressBar); } private void goToAuthScreen() { Intent intent = new Intent(SplashScreen.this, AuthorizationScreen.class); startActivity(intent); overridePendingTransition(R.anim.fade_in, R.anim.fade_out); SplashScreen.this.finish(); } private class LogoTask extends AsyncTask<Void, Integer, Void> { private int progress; @Override protected void onPreExecute() { super.onPreExecute(); progress = 0; } @Override protected Void doInBackground(Void... params) { while( progress < TIMER_RUNTIME ) { try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); L.e("InterruptedException : " + e.getMessage()); } progress += 200; publishProgress(progress); } return null; } @Override protected void onProgressUpdate(Integer... values) { int progress = progressBar.getMax() * values[0] / TIMER_RUNTIME; progressBar.setProgress(progress); } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); goToAuthScreen(); } } }