Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:09:47+00:00 2026-06-02T17:09:47+00:00

I am making an app in which i have to implement alpha effect in

  • 0

I am making an app in which i have to implement alpha effect in splash screen and when i load image it gives null pointer exception.The basic Problem while starting animation.If i remove start animation then my animation do not start at all.I am really stuck.Any help will be appreciated.My code is as follows:

public class SplashScreen extends Activity {


private Thread mSplashThread;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    System.out.println("hello");
    setContentView(R.layout.splash);

    final SplashScreen sPlashScreen = this; 

    Animation a1 = AnimationUtils.loadAnimation(this, R.anim.alpha);
        LinearLayout Ll=(LinearLayout)findViewById(R.id.mainLayoutheader);
        System.out.println("hello1");
        Ll.startAnimation(a1);
         System.out.println("hello2");


    // The thread to wait for splash screen events
    mSplashThread =  new Thread(){
        @Override
        public void run(){
            try {
                synchronized(this){
                    // Wait given period of time or exit on touch

                   // a.reset();


                    wait(6000);
                }
            }
            catch(InterruptedException ex){                    
            }

            finish();

            // Run next activity
            Intent intent = new Intent();
            intent.setClass(sPlashScreen, Main.class);
            startActivity(intent);
            stop();                    
        }
    };

    mSplashThread.start();        
}

} 

Exception is at L1.startAnimation(a1);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:09:48+00:00Added an answer on June 2, 2026 at 5:09 pm

    The problem was that the view in which i was showing image was empty.
    super.onCreate(savedInstanceState);

        // Splash screen view
        System.out.println("hello");
        setContentView(R.layout.splash);
        ImageView iv=(ImageView)findViewById(R.id.splashscreen12);
        Animation scaleAnim = AnimationUtils.loadAnimation(this,R.anim.alpha);
        iv.startAnimation(scaleAnim);
        scaleAnim.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationEnd(Animation animation) {
            // Start new activity after some delay
            TimerTask newActivity = new TimerTask() {
                @Override
                public void run() {
                    startActivity(new Intent(SplashScreeen.this,CallingActivity.class));
                    SplashScreeen.this.finish();
    
                }
            };
            Timer t = new Timer(false);
            t.schedule(newActivity, 2500);
        }
    
        @Override
        public void onAnimationRepeat(Animation animation) {
            // DO NOTHING
    
        }
    
        @Override
        public void onAnimationStart(Animation animation) {
            // DO NOTHING
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have implement that : making my app as a server which means
I am making an app in which I have to open default audio player.
I am making an App in which i have to play music from iPod
i m making APP which do image proceesing using java SE.i want to check
I am making an app in which i need to implement calling emergency medical
I am currently making an app which works with images. I need to implement
I am making an iPhone app which has a requirement to implement the UIPageControl.
I am making an app in which i have to use edit text and
I am making an app in which I have to encrypt the xml from
I am making an app in which i have to get latitude and longitude

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.