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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:04:20+00:00 2026-05-26T12:04:20+00:00

Im using a Sectioned adapter . Each section has a subAdapter. I get a

  • 0

Im using a Sectioned adapter. Each section has a “subAdapter”.

I get a problem when im removing all sections, and adding new ones. If the new amount of Sections > old amount of sections.

10-27 08:08:33.789: ERROR/AndroidRuntime(21550): java.lang.ArrayIndexOutOfBoundsException
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:5283)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4092)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.widget.AbsListView.onTouchEvent(AbsListView.java:2523)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.widget.ListView.onTouchEvent(ListView.java:3733)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.view.View.dispatchTouchEvent(View.java:3885)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-27 08:08:33.789: ERROR/AndroidRuntime(21550):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)

From what I’ve read this is a problem with getViewTypeCount. Im guessing that the method isn’t called when Im updating the adapter and calling adapter.notifyDataSetChanged();

The problem doesn’t occur if i set a new instance of the adapter as listAdapter.

How can I solve this problem? Can I force the activity to recall getViewTypeCount ?

  • 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-05-26T12:04:20+00:00Added an answer on May 26, 2026 at 12:04 pm

    Im guessing that the method isn’t called when Im updating the adapter and calling adapter.notifyDataSetChanged();

    Correct. getViewTypeCount() is only called once.

    How can I solve this problem?

    Do not change the value of getViewTypeCount() for the lifetime of your adapter.

    Can I force the activity to recall getViewTypeCount ?

    Not that I am aware of, sorry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the .load() function to load a section of html that has some
I have sectioned table view with check selection for each section(every section allows only
It seems that using Critical Sections quite a bit in Vista/Windows Server 2008 leads
I have an project csproj, with app.config file, and logging Ent.Library section using configsource
I'm using the TTThumbsViewController section of the three20 framework, and I have the status
I want to create section without numbers using the command \section*{Section Name}, but doing
In Karl Seguin's Foundations of Programming there is a small section on using the
Using Python I want to randomly rearrange sections of a string based on a
I'm using Jeff Atwood's Last Configuration Section Handler You'll Ever Need , but it
I am using Direct3D to display a number of I-sections used in steel construction.

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.