Back to project page Mero-Bhada-Meter.
The source code is released under:
GNU General Public License
If you think the Android project Mero-Bhada-Meter 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.nirab.merobhadameter; //from w w w. jav a 2s . c o m import java.io.File; import android.os.Bundle; import android.os.Environment; import android.preference.PreferenceManager; import android.app.Activity; //import android.view.Menu; import android.content.Intent; import android.content.SharedPreferences; public class MainActivity extends Activity { SharedPreferences preferences; boolean offline_mode; private String mapsFolder; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); preferences = PreferenceManager.getDefaultSharedPreferences(this); Thread timer = new Thread(){ public void run(){ try{ mapsFolder = Environment.getExternalStorageDirectory() .getAbsolutePath() + "/merobhadameter/maps/"; if (!new File(mapsFolder).exists()) { new File(mapsFolder).mkdirs(); } sleep(3000); } catch(InterruptedException e){ e.printStackTrace(); } finally{ offline_mode = preferences.getBoolean("offline_chkbox_preference", false); if (offline_mode){ Intent openMain = new Intent(MainActivity.this, OfflineMapActivity.class); startActivity(openMain); } else{ Intent openMain = new Intent(MainActivity.this, MapActivity.class); startActivity(openMain); } } } }; timer.start(); } @Override protected void onPause() { super.onPause(); finish(); } }