• Register
0 votes
915 views

Problem :

I am new to java, I am trying to display this feed in Custom list view but when I am trying to do so I am getting the following error

 "Attempted to finish an input event but the input event receiver has already been disposed"

The above error is in logcat and nothing happens in app after that,i have an adpter class as follows:

public class MyUserAdapter extends ArrayAdapter<UserData>{

private Context context;

private List<UserData> users_list;

public MyUserAdapter(Context context, int resource,List<UserData> objects) {

super(context, resource);

this.context= context;

this.users_list= objects;

 }

@Override

public View getView(int position, View convertView, ViewGroup parent) {

LayoutInflater inflater= (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View customview= inflater.inflate(R.layout.item_user, parent, false);

UserData userData=  users_list.get(position);

TextView tv = (TextView) customview.findViewById(R.id.textview1);

tv.setText(userData.getName());

return customview;

 }

}

 

LogCat:

hilz.myapplication W/EGL_emulation: eglSurfaceAttrib not implemented
hilz.myapplication W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa50c8260, error=EGL_SUCCESS
hilz.myapplication W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
6 5 3
7,540 points

1 Answer

0 votes

Solution :

In your Public MyUserAdapter function, your super is not passing in the Objects.

It should be as follows:

public MyUserAdapter(Context context, int resource,List<UserData> objects)
{
super(context, resource, objects);
this.context= context;
this.users_list= objects;
}

and not like below:

public MyUserAdapter(Context context, int resource,List<UserData> objects)
{
super(context, resource);
this.context= context;
this.users_list= objects;
}
9 7 4
38,600 points

Related questions

1 vote
1 answer 375 views
375 views
Problem : When I call a blank layout and afterwards call my layout it gives me the following error: the specified child already has a parent. you must call removeview() on the child's parent first.
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 292 views
292 views
Problem : I got following exception from my servlet: java.lang.illegalstateexception: response has already been committed
asked Oct 31, 2019 peterlaw 6.9k points