:: 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. not getting smooth rotation in android

I am rotating image with this code

RotateAnimation  ranim = new RotateAnimation(0f, 360f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); //,
200, 200); // canvas.getWidth() / 2, canvas.getHeight() / 2);
           stopImage=(ImageView) findViewById(R.id.stopimage);
           ranim.setDuration(2000);
        ranim.setInterpolator(new LinearInterpolator());
           ranim.setRepeatCount(Animation.INFINITE);
           ranim.setRepeatMode(Animation.RESTART);
       stopImage.startAnimation(ranim);


But rotation does not seem to be smooth,,how to make smooth rotation


Can anybody help please

It is urgent

Thanks
Kavitha

-- 

2. Use a dictionary for input method suggestions

Hi,
For various reasons, i'm trying to write my own input keyboard. So far
all is going well except that of creating the suggestions.

I've found the latinIME algorithm, which is all good.

However i'm having major difficulty working out how to load the
dictionary in the first place.

I've had a good look round the net, and found various suggestions, but
no definitive answers, and i cant seem to get any of them to work.

If anyone has any suggestions on how best to do it, or even better
some sample code, that would be brilliant.

Many Thanks

James

-- 

3. Blog post: LinearLayout gravity and layout_gravity explained

4. sms to specific port

5. Multi instance of app launch from status bar notification.

6. How to draw a circle of Given Radius on Google Maps

7. Blur an image