Hey,

I have a weird problem. For days i have a working list with movie
details i get from an xml rpc source. It loads the list very well and
I tried it again today and when i scroll down, always at the same list
item it gives me this error. I don't know what the problem is. It
shows my list items very good and now not anymore. If you want i can
give you my source code too! And it worked a few days ago and now
suddenty not :(

09-18 11:50:00.940: ERROR/ArrayAdapter(1561): You must supply a
resource ID for a TextView
09-18 11:50:00.950: DEBUG/AndroidRuntime(1561): Shutting down VM
09-18 11:50:00.950: WARN/dalvikvm(1561): threadid=3: thread exiting
with uncaught exception (group=0x4001aa28)
09-18 11:50:00.950: ERROR/AndroidRuntime(1561): Uncaught handler:
thread main exiting due to uncaught exception
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):
java.lang.IllegalStateException: ArrayAdapter requires the resource ID
to be a TextView
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:
347)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.moviemeter.SeparatedListAdapter.getView
(SeparatedListAdapter.java:93)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.AbsListView.obtainView(AbsListView.java:1255)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.addViewBelow(ListView.java:2795)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.scrollListItemsBy(ListView.java:2725)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.arrowScrollImpl(ListView.java:2225)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.arrowScroll(ListView.java:2172)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.commonKey(ListView.java:1977)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.onKeyDown(ListView.java:1924)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.KeyEvent.dispatch(KeyEvent.java:893)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.View.dispatchKeyEvent(View.java:3647)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:744)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ListView.dispatchKeyEvent(ListView.java:1909)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent
(PhoneWindow.java:1197)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.app.Activity.dispatchKeyEvent(Activity.java:1967)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent
(PhoneWindow.java:1684)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.TabHost.dispatchKeyEvent(TabHost.java:272)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent
(PhoneWindow.java:1197)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.app.Activity.dispatchKeyEvent(Activity.java:1967)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent
(PhoneWindow.java:1684)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:
2329)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2299)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1621)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.os.Handler.dispatchMessage(Handler.java:99)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.os.Looper.loop(Looper.java:123)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
java.lang.reflect.Method.invokeNative(Native Method)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
java.lang.reflect.Method.invoke(Method.java:521)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:791)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
dalvik.system.NativeStart.main(Native Method)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561): Caused by:
java.lang.ClassCastException: android.widget.LinearLayout
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     at
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:
340)
09-18 11:50:00.990: ERROR/AndroidRuntime(1561):     ... 40 more

This is my cinemaAdapter class for making my list!

 private class cinemaAdapter extends ArrayAdapter<FilmDetail> {

        private List<FilmDetail> items;

        public cinemaAdapter(Context context, List<FilmDetail> films)
{
                super(context, R.layout.cinema_row, films);
                this.items = films;
        }
        public View getView(int position, View convertView, ViewGroup
parent) {
                View v = convertView;
                FilmDetail o = items.get(position);

                if (v == null) {
                    LayoutInflater vi = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    v = vi.inflate(R.layout.cinema_row, null);
                }

                if (o != null) {
                        TextView tt = (TextView) v.findViewById
(R.id.text1);
                        TextView genre = (TextView) v.findViewById
(R.id.genre);
                        TextView directors = (TextView) v.findViewById
(R.id.regisseur);
                        TextView actors = (TextView) v.findViewById
(R.id.acteurs);
                        TextView votes = (TextView) v.findViewById
(R.id.votes);
                        ImageView imgCinema = (ImageView)
v.findViewById(R.id.imgCinema);
                        RatingBar cinemaRating = (RatingBar)
v.findViewById(R.id.cinemarating);

                        if (tt != null)
                        {
                           tt.setText(o.getTitle() + " (" + o.getYear
() + ")");
                        }
                        if (genre !=null)
                        {
                                if (o.getDuration().equals("0"))
                                {
                                        genre.setText(o.getGenres_text());
                                }
                                else{
                                        genre.setText(o.getGenres_text() + ", " 
+
o.getDuration() + " minuten");
                                }
                        }
                        if (directors != null)
                        {
                           directors.setText(o.getDirectors_text());
                        }
                        if (actors != null)
                        {
                           actors.setText(o.getActors_text());
                        }
                        if (votes != null)
                        {
                                if (o.getVotes_count().equals("0"))
                                {
                                        votes.setText(" (geen stemmen)");
                                }
                                else {
                                        votes.setText(" (" + 
o.getVotes_count()+ "
stemmen)");
                                }

                        }
                        if (imgCinema != null)
                        {
                                int map = 0;
                                int filmId = Integer.valueOf(o.getFilmId());
                                if (filmId >= 1000)
                                        map = 
Integer.valueOf(o.getFilmId().substring
(0, Integer.valueOf(o.getFilmId().length()) - 3) + "000");

                                String url = "http://www.moviemeter.nl/images/
covers/" + map + "/" + filmId + ".jpg";
                                Bitmap bitmap = moviemeterUtils.loadBitmap
(url.toString());
                                imgCinema.setImageBitmap(bitmap);
                        }

                        if (cinemaRating != null)
                        {
                                cinemaRating.setRating(Float.valueOf
(o.getAverage()));
                        }
                }
                return v;
        }
    }

Thank you for helping me!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to