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

  • Home
  • SEARCH
  • 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 6734259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:52:03+00:00 2026-05-26T10:52:03+00:00

I get an error like this in logcat when i try to run my

  • 0

I get an error like this in logcat when i try to run my script. I compared it and it is the onClickListener. Any suggestions to fix this problem? Still a beginner.

  • 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-05-26T10:52:03+00:00Added an answer on May 26, 2026 at 10:52 am

    The problem exists here:

    View splashscreen = (View) findViewById(R.layout.splash);
    splashscreen.setOnClickListener(this);
    

    You are getting an exception because splashscreen is null, and calling setOnClickListener() on a null pointer is not allowed. The reason that pointer is null is because you need to obtain a reference to the view from your XML using a proper ID. Your splash.xml file located in res/layout is being loaded as the content view for the Activity, but you should have a proper R.id value associated with that particular view.

    In splash.xml, the View you declare for this purpose should have an android:id="@+id/something" attribute in it’s XML declaration (I picked “something” out of the air, this identifier can be whatever you want). You would then call:

    //Hint: You don't have to cast the result if the pointer is a plain vanilla View
    View splashscreen = findViewById(R.id.something);
    splashscreen.setOnClickListener(this);
    

    Then you will get a valid reference to the view and your set method will not fail.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error when compiling a C# application. Looks like a trivial error,
This coding i got from here. I get error in log cat view like
That's the first time i get an error like this one, let me explain
in my system when i am opening the database i get this error like
sometimes i get an error like table is marked as corrupt and shld be
Like the title says, the error I get is the following: An invalid '/'
I have this query and I get error Operand should contain 1 column(s), whats
In our application we've run into an error numerous times where we get error
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
When we try to create a view within a funcion we get ERROR: there

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.