:: problem with TextSwitcher

by Imran » Thu, 13 Nov 2008 03:29:40 GMT


Sponsored Links
 Hi All

       This is my code... i am  using  TextSwitcher.... i think  every
thing is fine but it is still throwing ClassCastException

switcher1 = (TextSwitcher) findViewById(R.id.switcher1);
                switcher2 = (TextSwitcher) findViewById(R.id.switcher2);

                switcher1.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return score;
                        }
                });

                switcher2.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return level;
                        }
                });


 This is the exception

 11-12 16:54:28.093: ERROR/AndroidRuntime(1609): Caused by:
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams

And it is occuring at

     switcher1.setFactory(new ViewSwitcher.ViewFactory() {
                        public View makeView() {
                                return score;
                        }
                });


     can any help me out please.....!!!!

Cheers,
Imran

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. A timer thread and url fetch thread in same activity.

I am having problems with a timer that should fetch http results from
the web every 5 minutes.
I having problems with two threads - often I cannot even turn them off
or keep the timer going without upsetting the apple cart.

Should I start using wait() and notify(), a separate service or
continue trying to get them to be friends with each other in the same
activity. At present its all very badly behaved and I feel as though I
am juggling with marbles.

-- 

2. how to remove a view

Hi,

How to remove a view added by addContentView method?

Thanks,
Billsen

--~--~---------~--~----~------------~-------~--~----~

3. Retrieve the Starred Contacts

4. Issue tracker and errors in pages

5. IllegalStateException: Fragment not added in ActionBarTabs example

6. Fragment animation as in Honeycomb Gmail app - how to do that?

7. Does Application Error Reports support crashes in native code?