Guest User

Untitled

a guest
Oct 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. package com.a1.HudSeeker;
  2.  
  3. import savemanager.com.DBSaveManager;
  4.  
  5. import android.app.Activity;
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.view.Window;
  9.  
  10. public class Splash extends Activity {
  11.  
  12. protected boolean _active = true;
  13. protected int _splashTime = 1000;
  14.  
  15.  
  16. public void onCreate(Bundle savedInstanceState) {
  17. super.onCreate(savedInstanceState);
  18. requestWindowFeature(Window.FEATURE_NO_TITLE);
  19. setContentView(R.layout.main);
  20. System.out.print("hello");
  21. DBSaveManager.initializeSharedPreferences(this);
  22. Settings loginInfoBean = new Settings();
  23. loginInfoBean.setlogin("false");
  24.  
  25. DBSaveManager dbSaveManager = new DBSaveManager();
  26. dbSaveManager.saveLoginInfoBeanFirstTime(loginInfoBean);
  27.  
  28. // thread for displaying the SplashScreen
  29. Thread splashTread = new Thread() {
  30. @Override
  31. public void run() {
  32. try {
  33. int waited = 0;
  34. while(_active && (waited < _splashTime)) {
  35. sleep(70);
  36.  
  37. waited += 70;
  38.  
  39. }
  40. finish();
  41. Intent intent=new Intent(Splash.this,HudSeekerHome.class);
  42. startActivity(intent);
  43.  
  44. } catch (InterruptedException e) {
  45. // TODO Auto-generated catch block
  46. e.printStackTrace();
  47. }
  48. }
  49. };
  50. splashTread.start();
  51. }
  52.  
  53. }
Add Comment
Please, Sign In to add comment