Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

No ItemViewDelegate added that matches position=3 in data source

Open
#131 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, java
Domain
mobile

Research direction

Start at MultiItemTypeAdapter and reproduce the reported exception for data-source position 3, using the custom adapter overrides shown in the issue as context. Trace why no ItemViewDelegate matches that position; done means the invalid delegate case is handled without requiring the posted exception-swallowing workaround.

Written by the indexing model from the issue text.

Description

fixt this Exception you need to custom MultiItemTypeAdapter

fixit code

`
@Override
public int getItemViewType(int position) {
try {
return super.getItemViewType(position);
}catch (Exception e){
return -1;
}
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType==-1){
Log.e("---",viewType+"**");
ItemViewDelegate itemViewDelegate = new EmptyDelegate();
int layoutId = itemViewDelegate.getItemViewLayoutId();
ViewHolder holder = ViewHolder.createViewHolder(mContext, parent, layoutId);
onViewHolderCreated(holder,holder.getConvertView());
setListener(parent, holder, viewType);
return holder;

    }
    return super.onCreateViewHolder(parent, viewType);
}

@Override
public void convert(ViewHolder holder, Object o) {
    try {
        super.convert(holder, o);
    }catch (Exception e){

    }
}

`

Dominant language
Java
Stars
4.7k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hongyangAndroid/baseAdapter

All issues in hongyangAndroid/baseAdapter

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.