package com.find.bts;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
Handler handler;
Runnable runnable;
ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
img = findViewById(R.id.img);
img.animate().alpha(4000).setDuration(0);
handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent dap = new Intent(MainActivity.this, Login.class);
startActivity(dap);
finish();
}
}, 4000);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
xmlns:app="<http://schemas.android.com/apk/res-auto>"
xmlns:tools="<http://schemas.android.com/tools>"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#476BB3"
android:gravity="center"
tools:context=".MainActivity">
<ImageView
android:id="@+id/img"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/airbts"
android:layout_gravity="center"/>
</LinearLayout>
여기 구현할 때 추가한 xml