Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/bg"
- android:orientation="horizontal">
- <ImageView
- android:id="@+id/imageView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:adjustViewBounds="true"
- android:contentDescription="@string/app_name"
- android:padding="15dp"
- app:srcCompat="@drawable/app_name" />
- <ImageView
- android:id="@+id/imageView3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:contentDescription="@string/app_name"
- android:padding="50dp"
- app:srcCompat="@drawable/icon_phone" />
- </FrameLayout>
- public class SplashScreenActivity extends Activity {
- // Время в милесекундах, в течение которого будет отображаться Splash Screen
- private final int SPLASH_DISPLAY_LENGTH = 3000;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.splash_screen);
- //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- // По истечении времени, запускаем главный активити, а Splash Screen закрываем
- Intent mainIntent = new Intent(SplashScreenActivity.this, MainActivity.class);
- SplashScreenActivity.this.startActivity(mainIntent);
- SplashScreenActivity.this.finish();
- }
- }, SPLASH_DISPLAY_LENGTH);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement