Я получаю эту ошибку ** «java .lang.NullPointerException: попытка вызвать виртуальный метод void android .widget.ImageView.setAnimation (android .view.animation.Animation)» для нулевого объекта ссылка "****
public class MainActivity extends AppCompatActivity {
private static int SPLASH_SCREEN = 5000;
Animation topAnim,bottomAnim;
ImageView image;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
topAnim = AnimationUtils.loadAnimation(this, R.anim.top_animation);
bottomAnim = AnimationUtils.loadAnimation(this, R.anim.bottom_animation);
ImageView Logo = findViewById(R.id.Logo);
TextView slogan = findViewById(R.id.slogan);
image.setAnimation(topAnim);
slogan.setAnimation(bottomAnim);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(MainActivity.this,Dashboard.class);
startActivity(intent);
finish();
}
},SPLASH_SCREEN);
}
}