Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:background="@drawable/bg"
  7. android:orientation="horizontal">
  8.  
  9. <ImageView
  10. android:id="@+id/imageView2"
  11. android:layout_width="wrap_content"
  12. android:layout_height="wrap_content"
  13. android:layout_gravity="top"
  14. android:adjustViewBounds="true"
  15. android:contentDescription="@string/app_name"
  16. android:padding="15dp"
  17. app:srcCompat="@drawable/app_name" />
  18.  
  19. <ImageView
  20. android:id="@+id/imageView3"
  21. android:layout_width="wrap_content"
  22. android:layout_height="wrap_content"
  23. android:layout_gravity="center"
  24. android:adjustViewBounds="true"
  25. android:contentDescription="@string/app_name"
  26. android:padding="50dp"
  27. app:srcCompat="@drawable/icon_phone" />
  28.  
  29. </FrameLayout>
  30.  
  31. public class SplashScreenActivity extends Activity {
  32. // Время в милесекундах, в течение которого будет отображаться Splash Screen
  33. private final int SPLASH_DISPLAY_LENGTH = 3000;
  34.  
  35. @Override
  36. protected void onCreate(Bundle savedInstanceState) {
  37. super.onCreate(savedInstanceState);
  38. setContentView(R.layout.splash_screen);
  39. //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  40.  
  41. new Handler().postDelayed(new Runnable() {
  42. @Override
  43. public void run() {
  44. // По истечении времени, запускаем главный активити, а Splash Screen закрываем
  45. Intent mainIntent = new Intent(SplashScreenActivity.this, MainActivity.class);
  46. SplashScreenActivity.this.startActivity(mainIntent);
  47. SplashScreenActivity.this.finish();
  48. }
  49. }, SPLASH_DISPLAY_LENGTH);
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement