Help with splash screen

  • Replies:1
Georgi Dimitrov
  • Forum posts: 2

Oct 10, 2017, 12:28:26 PM via Website

Hello
i try to add splash screen in my project and insert some admob ad code
but i have some error
here is my project
drive.google.com/open?id=0B2u6yCWB2rETMjJhNXpOSEswNXc
For splash screen i try this code
www.androidhive.info/2013/07/how-to-implement-android-splash-screen-2/
and few more but all of them give me some error
this source
androidhive.info/2013/07/how-to-implement-android-splash-screen-2/
give me this errors .
Can somebody help me
Error:(16, 32) error: cannot find symbol variable activity_splash
Error:Execution failed for task ':livewallpaper:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

package com.customlivewallpapercreator.live_wallpaper.amin;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreen extends Activity {

// Splash screen timer
private static int SPLASH_TIME_OUT = 3000;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash); - --- the error

   new Handler().postDelayed(new Runnable() {

       /*
        * Showing splash screen with a timer. This will be useful when you
        * want to show case your app logo / company
        */

       @Override
       public void run() {
           // This method will be executed once the timer is over
           // Start your app main activity
           Intent i = new Intent(SplashScreen.this, MainActivity.class);
           startActivity(i);

           // close this activity
           finish();
       }
   }, SPLASH_TIME_OUT);

}

}

Reply
Georgi Dimitrov
  • Forum posts: 2

Oct 10, 2017, 12:58:33 PM via Website

and now this code is working :)
setContentView(R.layout.activity_splash_screen);
before give me error :)

i can make a build but app is crashing
in debug give me this
Error running SplashScreen: The activity must be exported or contain an intent-filter

— modified on Oct 10, 2017, 1:09:47 PM

Reply