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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:17:35+00:00 2026-06-17T07:17:35+00:00

I have extended the spinner class in order to customize it, but i can’t

  • 0

I have extended the spinner class in order to customize it, but i can’t figure out how to use it in my code.

public class mySpinner extends Spinner {
......
}

I have an existing activity that uses a spinner and I want to change it to use mySpinner class.

Originally:

    Spinner spinner = (Spinner) textEntryView
            .findViewById(R.id.account_spinner);

and

    <Spinner
    android:id="@+id/account_spinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:prompt="@string/ADALabel1"
    android:layout_alignLeft="@+id/newassetsymbol"
    android:layout_below="@+id/assetclass_spinner" />

first I tried:

    mySpinner spinner = (Spinner) textEntryView
            .findViewById(R.id.account_spinner);

compile error (makes sense).
then I tried:

    mySpinner spinner = (mySpinner) textEntryView
            .findViewById(R.id.account_spinner);

runtime cast error.
Then I changed the layout with the previous line:

 <mySpinner
    android:id="@+id/account_spinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:prompt="@string/ADALabel1"
    android:layout_alignLeft="@+id/newassetsymbol"
    android:layout_below="@+id/assetclass_spinner" />

01-12 06:50:02.664: E/AndroidRuntime(597): Caused by: java.lang.ClassNotFoundException: android.view.mySpinner in loader dalvik.system.PathClassLoader[/data/app/org.sample.sample-1.apk]

This does not seem thst hard but I am missing something. Can someone help?
Thank you.

  • 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-17T07:17:36+00:00Added an answer on June 17, 2026 at 7:17 am

    When using custom View components in XML, you need to use the complete class path.

    <com.example.appname.mySpinner />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have extended PHP's mysqli class, which works fine. But how can I make
I have a main class and two extended classes: class Main { public $foo;
I have a class named CropImageView which is extended from ImageView . but the
I have extended the ViewPager class and implemented onPageChangeListener. I use this ViewPager in
I have extended a cursor adapter public class MyAdapter extends CursorAdapter { MyAdapter(View view,
I have extended a class like so: public class CormantRadDock : Telerik.Web.UI.RadDock { public
In my wpf application i have extended the datatrigger class as below public class
I have extended the Application class like this: public class MyApplication extends Application {
My question may be a bit unclear, but I have extended the View class
I have extended a server control (not a user control) and put the code

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.