I have no problem with the data mapping and TextViews. It fully works when i don't use a seperatedList adapter.. So there is problem with this seperatedListAdapter.. Is there another way i can use to divide my list in sections with headers?
On 24 sep, 22:36, Marco Nelissen <[email protected]> wrote: > Somewhere in your code, you are passing a resource ID to the system > that should refer to a TextView, but doesn't. > My guess is you've set your data mapping up incorrectly. > > On Thu, Sep 24, 2009 at 1:25 PM, Wouter <[email protected]> wrote: > > > Can someone help me please! Really need to get this fixed! > > > On Sep 19, 3:10 pm, Wouter <[email protected]> wrote: > >> Do you know a solution? > > >> On 18 sep, 19:00, Wouter <[email protected]> wrote: > > >> > This is the function: > > >> > public View getView(int position, View convertView, ViewGroup parent) > >> > { > >> > int sectionnum = 0; > >> > for(Object section : this.sections.keySet()) { > >> > Adapter adapter = sections.get(section); > >> > int size = adapter.getCount() + 1; > > >> > // check if position inside this section > >> > if(position == 0) return > >> > headers.getView(sectionnum, convertView, > >> > parent); > >> > if(position < size) return > >> > adapter.getView(position - 1, > >> > convertView, parent); > > >> > // otherwise jump into next section > >> > position -= size; > >> > sectionnum++; > >> > } > >> > return null; > >> > } > > >> > 93: --> if(position == 0) return headers.getView(sectionnum, > >> > convertView, parent); > > >> > resource file: > > >> > <?xml version="1.0" encoding="utf-8"?> > >> > <LinearLayout > >> > xmlns:android="http://schemas.android.com/apk/res/android" > >> > android:orientation="horizontal" > >> > android:layout_width="fill_parent" > >> > android:layout_height="fill_parent" > >> > > > > >> > <ImageView android:id="@+id/imgCinema" > >> > android:layout_width="60px" > >> > android:layout_margin="5px" > >> > android:src="@drawable/icon" > >> > android:layout_height="80px"> > >> > </ImageView> > > >> > <LinearLayout > >> > android:orientation="vertical" android:layout_width="fill_parent" > >> > android:layout_height="fill_parent" > >> > > > > >> > <TextView > >> > android:id="@+id/text1" > >> > android:layout_width="fill_parent" > >> > android:layout_height="wrap_content" > >> > android:textSize="16px" > >> > android:textStyle="bold" > >> > android:text="FilmTitle"/> > > >> > <LinearLayout > >> > android:orientation="horizontal" > >> > android:layout_width="wrap_content" > >> > android:layout_height="wrap_content" > >> > > > >> > <RatingBar android:id="@+id/cinemarating" > >> > style="?android:attr/ratingBarStyleSmall" > >> > android:layout_width="wrap_content" > >> > android:layout_height="wrap_content" > >> > android:layout_gravity="center_vertical" /> > >> > <TextView > >> > android:id="@+id/votes" > >> > android:layout_width="fill_parent" > >> > android:layout_height="wrap_content" > >> > android:textSize="12px" > >> > android:text="votes"/> > >> > </LinearLayout> > >> > <TextView > >> > android:id="@+id/genre" > >> > android:layout_width="fill_parent" > >> > android:layout_height="wrap_content" > >> > android:textSize="12px" > >> > android:text="genre"/> > >> > <TextView > >> > android:id="@+id/regisseur" > >> > android:layout_width="fill_parent" > >> > android:layout_height="wrap_content" > >> > android:textSize="12px" > >> > android:text="regisseur"/> > >> > <TextView > >> > android:id="@+id/acteurs" > >> > android:layout_width="fill_parent" > >> > android:layout_height="wrap_content" > >> > android:textSize="12px" > >> > android:text="acteurs"/> > > >> > </LinearLayout> > > >> > </LinearLayout> > > >> > But without this seperatedlistadapter it is working (was working > >> > before with it too). So don't know what problem is.. > > >> > hope you can help me! > > >> > Wouter > >> > On 18 sep, 18:41, "Yusuf Saib (T-Mobile USA)" <yusuf.s...@t- > > >> > Mobile.com> wrote: > >> > > Where in your code is SeparatedListAdapter.java:93? And can you post > >> > > the resource xml as well? > > >> > > Yusuf Saib > >> > > Android > >> > > ·T· · ·Mobile· stick together > >> > > The views, opinions and statements in this email are those of the > >> > > author solely in their individual capacity, and do not necessarily > >> > > represent those of T-Mobile USA, Inc. > > >> > > On Sep 18, 7:16 am, Wouter <[email protected]> wrote: > > >> > > > I removed my seperatedlistadapter and now it worked.. :s But it was > >> > > > working before with my seperatedlistadapter :( > > >> > > > On 18 sep, 14:47, Wouter <[email protected]> wrote: > > >> > > > > Really dont find what the problem is, the weird is it worked and i > >> > > > > havent changed anything :( > > >> > > > > On 18 sep, 12:02, Wouter <[email protected]> wrote: > > >> > > > > > 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 > > ... > > meer lezen » --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

