question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"java.lang.IndexOutOfBoundsException

See original GitHub issue

I’m getting an “java.lang.IndexOutOfBoundsException: Invalid index 6, size is 6 at java.util.ArrayList.throwIndexOutOfBoundsException”

while using Admobadapter. This is my click handler in recycler adapter class

` @Override public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) { holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { callback.onOverViewSelected(data.get(holder.getAdapterPosition())); } });

    if (holder instanceof TextViewHolder) {

        ((TextViewHolder) holder).title.setText(data.get(position).getText(context));

    }  else if (holder instanceof ImageViewHolder) {

        Picasso.with(context)
                .load(data.get(position).categoryImageUrl)
                .placeholder(R.drawable.placeholder)
                .into(((ImageViewHolder) holder).image);
        ((ImageViewHolder) holder).title.setText(data.get(position).getText(context));
    }
}`

Logcat info-----

05-24 18:38:33.743 6393-6393/com.malayalamapp.plingapp E/chromium: [ERROR:interface_registry.cc(99)] Failed to locate a binder for interface: autofill::mojom::AutofillDriver 05-24 18:38:33.790 6393-6393/com.malayalamapp.plingapp E/chromium: [ERROR:interface_registry.cc(99)] Failed to locate a binder for interface: autofill::mojom::AutofillDriver 05-24 18:38:33.828 6393-6393/com.malayalamapp.plingapp E/chromium: [ERROR:interface_registry.cc(99)] Failed to locate a binder for interface: autofill::mojom::AutofillDriver 05-24 18:38:33.852 6393-6393/com.malayalamapp.plingapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.malayalamapp.plingapp, PID: 6393 java.lang.IndexOutOfBoundsException: Invalid index 6, size is 6 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:260) at java.util.ArrayList.get(ArrayList.java:313) at com.malayalamapp.plingapp.fbdirectfeed.providers.overview.CategoryAdapter$1.onClick(CategoryAdapter.java:70) at android.view.View.performClick(View.java:5269) at android.view.View$PerformClick.run(View.java:21556) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5769) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

It happens when click on last item…Any idea about this issue?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hoanghiephuicommented, Jun 14, 2017

You should try callback.onOverViewSelected(data.get(position)) instead of callback.onOverViewSelected(data.get(holder.getAdapterPosition()));

0reactions
hoanghiephuicommented, Sep 9, 2017

@Sarun1001 If you have fork lib, You can create pull requests

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexOutOfBoundsException (Java Platform SE 8 )
Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out...
Read more >
how to fix java.lang.IndexOutOfBoundsException
This error happens because your list lstpp is empty (Nothing at index 0). So either there is a bug in your getResult() function,...
Read more >
[Solved] java.lang.IndexOutOfBoundsException
lang.IndexOutOfBoundsException in Java. According to Oracle docs, IndexOutOfBoundsException is a subclass of RuntimeException. It is an unchecked exception that ...
Read more >
Java Exception Handling - IndexOutOfBoundsException
The IndexOutOfBoundsException is thrown when attempting to access an invalid index within a collection, such as an array , vector , string ,...
Read more >
java.lang.IndexOutOfBoundsException crash message | Fandom
// Would you like a cupcake? Time: 4/4/16 3:30 PM. Description: Unexpected error. java.lang.IndexOutOfBoundsException. at java ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found