- Forum posts: 2
Oct 10, 2017, 12:28:26 PM via Website
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
Error16, 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);
}
}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.