Back to project page Geoloqi-Android-Geotracks.
The source code is released under:
GNU General Public License
If you think the Android project Geoloqi-Android-Geotracks 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.geoloqi.geotracks.ui; //from w ww.jav a2 s.co m import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import com.geoloqi.android.sdk.LQSharedPreferences; import com.geoloqi.android.sdk.LQTracker.LQTrackerProfile; import com.geoloqi.geotracks.R; /** * This Activity is responsible for launching the Geoloqi client * and performing any set up before the application is started. A * splash screen with corporate branding is displayed to the user. * * @author Tristan Waddington */ public class LauncherActivity extends Activity { /** The minimum amount of time that the splash screen will be displayed. */ private static final int SPLASH_TIMEOUT = 2000; /** A runnable that will launch the main activity. */ private Runnable mStartMainActivity = new Runnable() { @Override public void run() { startActivity(new Intent(LauncherActivity.this, MainActivity.class)); } }; private final Handler mHandler = new Handler(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); // Start up the tracking service if (SettingsActivity.isTrackerEnabled(this)) { LQTrackerProfile savedProfile = LQSharedPreferences.getTrackerProfile(this); SettingsActivity.startTracker(this, savedProfile); } // Show the splash screen then start the main activity mHandler.postDelayed(mStartMainActivity, SPLASH_TIMEOUT); } @Override public void onPause() { super.onPause(); // If the user has stopped the launcher activity, don't // continue launching the main activity. mHandler.removeCallbacks(mStartMainActivity); } }