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 5934601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:08:12+00:00 2026-05-22T15:08:12+00:00

I declared a ImageView on my layout (XML) but when I try to grab

  • 0

I declared a ImageView on my layout (XML) but when I try to grab it by the ID I’m getting a TextField!?! Then my code throw a ClassCastException.

Here is my layout code (splash.xml):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    style="@android:style/Theme.Light" android:layout_height="wrap_content" android:background="@drawable/bg">
    <ImageView android:layout_height="wrap_content" android:layout_width="match_parent" android:src="@drawable/splash" android:layout_marginTop="20pt" android:id="@+id/splashLogo"></ImageView>
    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/app_name" android:id="@+id/splashTitle" android:textStyle="bold" android:textSize="@dimen/title_size" android:layout_gravity="center" android:lineSpacingExtra="@dimen/spacer" android:gravity="center"></TextView>
    <TextView android:id="@+id/splashCopyleft" android:textSize="@dimen/version_size" android:lineSpacingExtra="@dimen/version_spacing" android:layout_width="wrap_content" android:gravity="center" android:layout_height="wrap_content" android:text="@string/app_version_info" android:layout_gravity="center" android:textColor="@color/version"></TextView>
</LinearLayout>

Here is my Java (Activity) code:

// imports

public class SplashActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        // Grab a ClassCastException here
        ImageView logo = (ImageView) findViewById(R.id.splashLogo); 

        // Never get here :'(
        Log.i("GOT", logo.toString());
    }
}
  • 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-22T15:08:13+00:00Added an answer on May 22, 2026 at 3:08 pm

    Sometimes Eclipse shifts resource ids. Try cleaning your project and building it again.

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

Sidebar

Related Questions

I've declared Javascript arrays in such a way that I could then access them
An XML attribute declared as xs:boolean can acceptable be true, false, 0 or 1.
I think I've declared a Vector with an object correctly. But, I don't know
I have declared a class variable in here void downloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) {
I declared a private variable vector<SomeClass> theVector; someplace inside my SomeClass class. Why can't
If a variable is declared as static in a function's scope it is only
Why main must be declared as if it has external linkage? Why it should
I've declared the following bean in my Spring config <bean id=templateCacheClearingTask class=org.springframework.scheduling.timer.ScheduledTimerTask> <property name=delay
Why must class members declared as const be initialized in the constructor initializer list
I have two classes declared like this: class Object1 { protected ulong guid; protected

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.